控制器签名(我也尝试过请求者):
@RequestMapping(value = "/Lame", method = RequestMethod.POST)
public
@ResponseBody
boolean getLame(@RequestParam String strToMatchA, @RequestParam String strToMatchB) {}
Run Code Online (Sandbox Code Playgroud)
这就是我的json:
{
"strToMatchA": "EN",
"strToMatchB": "lon"
}
Run Code Online (Sandbox Code Playgroud)
不工作,我收到错误:
org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'strToMatchA' is not present
Run Code Online (Sandbox Code Playgroud)
从方法签名中删除第一个参数然后使其工作(方法被正确调用),我该怎么办?
当我更改要注释的方法参数时,@RequestBody我得到以下错误:
java.io.IOException: Stream closed
Run Code Online (Sandbox Code Playgroud)