2
我的Html页面没有以json对象的形式检索有效载荷。相反,它正在返回字符串。任何帮助Thymeleaf表单不返回json对象
HTML代码段:
<form th:object="${case}" novalidate="true" data-model="case" action="/hcp/patient/details/insurance" method="POST">
控制器:
@RequestMapping(
value = {"/hcp/patient/details/insurance"},
produces = "application/json",
method = {RequestMethod.PUT, RequestMethod.POST})
final @ResponseBody String updatePatientInsurance(final HttpServletRequest request,
@RequestBody String payload,
BindingResult bindingResult) throws InvalidFormException, Exception {
因为'payload'是字符串? –
它应该串起Json。但是该字符串不是json格式。 –
这可能有所帮助:https://stackoverflow.com/questions/34001725/how-to-automatically-parse-string-requestbody-as-json –