Here is the controller signature I have tried using @RequestBody:
@RequestMapping(value = "/Lame", method = RequestMethod.POST)
public
@ResponseBody
boolean getLame(@RequestParam String strToMatchA, @RequestParam String strToMatchB) {}
This is the json I am using:
{
"strToMatchA": "EN",
"strToMatchB": "lon"
}
However, it doesn't work and I receive this error message:
org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'strToMatchA' is not present
If I remove the first parameter from the method signature, the method works properly. What could be the issue here?
Furthermore, when I change the method parameters to be annotated with @RequestBody
, I encounter a different error:
java.io.IOException: Stream closed