6 回答
TA贡献1777条经验 获得超10个赞
http状态码406是服务器无法根据客户端请求的内容特性完成请求
请求头Accept:application/json
响应头Content-Type:application/json
TA贡献1786条经验 获得超11个赞
方法一:
springmvc配置
<mvc:annotation-driven>
<mvc:message-converters register-defaults="true">
<bean id="jacksonMessageConverter" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/html;charset=UTF-8</value>
<value>application/json;charset=UTF-8</value>
</list>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
方法二:修改<url-pattern>.html</url-pattern>成.do或者*.action之类
添加回答
举报
