【发布时间】:2018-01-04 01:32:14
【问题描述】:
我的 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 {...
【问题讨论】:
-
因为
payload是字符串? -
应该是字符串化的Json。但是字符串不是json格式的。
-
表单无法触发ajax调用,将转换为json。
-
所以我有一个 ajax 调用,但是当我使用这个表单访问选项卡时,渲染功能没有触发。这就是我发现的问题。期待解决这个问题。完成后会更新。感谢您的回复。
标签: javascript java ajax spring thymeleaf