[英]Thymeleaf form not returning json object
我的HTML页面没有以json对象的形式检索有效负载。 而是返回字符串。 任何帮助
HTML代码段:
<form th:object="${case}" novalidate="true" data-model="case" action="/hcp/patient/details/insurance" method="POST">
控制器:
@ResponseBody
@RequestMapping(value = {"/hcp/patient/details/insurance"},
produces = "application/json", method = {RequestMethod.PUT, RequestMethod.POST})
final String updatePatientInsurance(final HttpServletRequest request,
@RequestBody String payload, BindingResult bindingResult)
throws InvalidFormException, Exception {...
访问时显式呈现了选项卡,从而解决了该问题。
PS:render函数实际上将有效载荷转换为JSON对象
formController.render(tabContent, url);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.