通过@ResponseBody标签返回JSON数据的方法都报406错:
解决方法:
@RequestMapping(value = "/user/updatepwd", method = { RequestMethod.POST }, produces = "text/plain;charset=utf-8")将produces 的值改为application/json;charset=utf-8
如:
@RequestMapping(value = "/user/lostpwd", method = { RequestMethod.POST }, produces = "application/json;charset=utf-8")
本文解决在使用@ResponseBody标签返回JSON数据时遇到的HTTP 406 Not Acceptable错误,通过将produces参数从text/plain;charset=utf-8更改为application/json;charset=utf-8来解决。
1716





