Could not find acceptable representation:“找不到可接受的形式”
发现可能出发这种异常情况的原因:
请求contenttype=application/json;charset=UTF-8,而这里是produces=text/html
原来代码:
@RequestMapping(value = "/getPage.action", method = RequestMethod.POST, produces = "text/html; charset=UTF-8")
解决方法:去掉produces = "text/html; charset=UTF-8"这段代码或者设置produces=application/json;charset=UTF-8
如果返回的信息是提示信息如“修改成功”等,则produces="text/html;charset=UTF-8",但如果返回的信息是json数据,则produces="application/json;charset=UTF-8"