首页 > Web开发 > 详细

HTTP Status 406 --- not acceptable according to the request "accept" headers

时间:2014-10-14 12:27:59      阅读:460      评论:0      收藏:0      [点我收藏+]

The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers.

使用以下方案解决

springmvc json配置方案

Spring4.1.0

使用<annotation-driven />MVC配置方法。

在pom.xml中增加

 1      <dependency>
 2             <groupId>com.fasterxml.jackson.core</groupId>
 3             <artifactId>jackson-core</artifactId>
 4             <version>2.4.3</version>
 5         </dependency>
 6         <dependency>
 7             <groupId>com.fasterxml.jackson.core</groupId>
 8             <artifactId>jackson-databind</artifactId>
 9             <version>2.4.3</version>
10         </dependency>
11         <dependency>
12             <groupId>com.fasterxml.jackson.core</groupId>
13             <artifactId>jackson-annotations</artifactId>
14             <version>2.4.3</version>
15         </dependency>

controller方法中增加@org.springframework.web.bind.annotation.ResponseBody注解

可以解决标题中的问题

HTTP Status 406 --- not acceptable according to the request "accept" headers

原文:http://www.cnblogs.com/javaleon/p/4023842.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!