The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers.
意思是请求不被接受。出现这种情况一般都是用了@ResponseBody注解,而springMVC中返回值类型转换器配置有问题
<bean id="contentNegotiationManagerFactoryBean"
class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
<property name="favorPathExtension" value="true"/><!--匹配后缀-->
<property name="favorParameter" value="false"/>
<property name="ignoreAcceptHeader" value="false"/>
<property name="mediaTypes">
<map>
<entry key="json" value="application/json"/>
</map>
</property>
</bean>
这段代码中的favorPathExtension是匹配请求的后缀,设置成true的时候是根据请求的后缀匹配响应的格式,如请求blog.json就会返回json格式。但是现在的请求路径是blog.html,在转换器中并没有配置html这个后缀对应的响应类型,所以就会报406的错误。解决这个问题,将favorPathExtension=false,禁用后缀匹配即可