环境如下
Spring: Spring 4.1.1
Json: Jackson 1.9.13
在返回Json数据时,报如下错误:
The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers.
解决办法:换jackson版本,2.4.3解决问题。
Pom.xml文件加入依赖如下
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version><span style="color:#FF0000;"><strong>2.4.3</strong></span></version>
</dependency>