Further improve detecttion of custom CNVR
Refine the approach of having <mvc:view-resolvers> detect and use the ContentNegotiationManager instance registered with <mvc:annotation-driven> introduced in the last commit. Issue: SPR-13559
This commit is contained in:
@@ -691,7 +691,7 @@ public class MvcNamespaceTests {
|
||||
|
||||
@Test
|
||||
public void testContentNegotiationManager() throws Exception {
|
||||
loadBeanDefinitions("mvc-config-content-negotiation-manager.xml", 15);
|
||||
loadBeanDefinitions("mvc-config-content-negotiation-manager.xml", 14);
|
||||
|
||||
RequestMappingHandlerMapping mapping = appContext.getBean(RequestMappingHandlerMapping.class);
|
||||
ContentNegotiationManager manager = mapping.getContentNegotiationManager();
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
|
||||
<mvc:annotation-driven content-negotiation-manager="contentNegotiationManager" />
|
||||
<mvc:annotation-driven content-negotiation-manager="mvcContentNegotiationManager" />
|
||||
|
||||
<mvc:view-resolvers>
|
||||
<mvc:content-negotiation/>
|
||||
</mvc:view-resolvers>
|
||||
|
||||
<bean id="contentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
|
||||
<bean id="mvcContentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
|
||||
<property name="mediaTypes">
|
||||
<value>
|
||||
xml=application/rss+xml
|
||||
|
||||
Reference in New Issue
Block a user