SpringMVC项目中406错误:
在请求返回json数据时
tomcat 报错
The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request “accept” headers.
汉语解释:
由该请求标识的资源仅能够生成具有根据请求“接受”标头不可接受的特征的响应。
原因:在springmvc中请求*.html不可以返回json数据。
由于上述原因造成的,我们可以用一下解决思路,
1. json的jar包没安装。
看文件中有没有json的依赖包,没有的话,pom文件加入jar包
<!-- Jackson Json处理工具包 -->
<dependency>
<groupId>com