2
My HTMLページがjsonオブジェクトの形式でペイロードを取得していません。代わりに文字列を返します。すべてのヘルプjsonオブジェクトを返さないThymeleafフォーム
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 {
にペイロードを変換し、レンダリング? –
これはJsonにストリング化する必要があります。しかし、文字列はjson形式ではありません。 –
これは役立ちます:https://stackoverflow.com/questions/34001725/how-to-automatically-parse-string-requestbody-as-json –