我们只是将我们的spring框架从4.1.1更新到4.2.5。有趣的是,我们发现从ContentNegotiatingViewResolver中删除了 ignoreAcceptHeader 方法。有什么想法吗?如何在4.2.x之后设置ignoreAcceptHeader属性?
以下是我们的旧代码
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<property name="ignoreAcceptHeader" value="true" />
<property name="defaultContentType" value="text/html; charset=UTF-8" />
<property name="mediaTypes">
<map>
<entry key="html" value="text/html; charset=UTF-8" />
<entry key="json" value="application/json; charset=UTF-8" />
</map>
</property>
<property name="viewResolvers">
<list>
<bean class="org.springframework.web.servlet.view.BeanNameViewResolver" />
<ref bean="viewResolver" />
</list>
</property>
</bean>