The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request “accept” headers.
最近有springmvc返回json数据时,遇到标题所示的问题,参考各种解决办法,解决不了。。ps: spring版本是4.3.0。
没办法把http://blog.youkuaiyun.com/stormwy/article/details/40080309提供的源码下载下来运行,发现可以运行。为什么他的就可以呢?不断排除错误原因,发现是spring版本导致的,此时已经花了一天的时间了。。。
上网一查,原来json处理方式发生了改变。
解决办法请参考:http://blog.youkuaiyun.com/kingof007/article/details/44237043
也就是添加,换成自己需要的版本。
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.5.1</version>
</dependency>