@ResponseBody注解返回对象,请求接口时返回406,错误信息为The resource identified by this request is only capable of generating respon……
解决办法:
- 检查相关pom依赖是否引入
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.5.0</version>
</dependency>
- 检查Spring配置文件
<context:annotation-config />
<mvc:annotation-driven />
- 后续补充 ……