Update view-resolver namespace

Issue: SPR-7093
This commit is contained in:
Rossen Stoyanchev
2014-07-12 22:19:18 -04:00
parent f54cee47b0
commit 5e1a5c8d51
16 changed files with 730 additions and 576 deletions

View File

@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<mvc:annotation-driven />
<mvc:view-resolution>
<mvc:content-negotiating use-not-acceptable="true">
<mvc:default-views>
<bean class="org.springframework.web.servlet.view.json.MappingJackson2JsonView" />
</mvc:default-views>
</mvc:content-negotiating>
<mvc:jsp />
<mvc:freemarker />
<mvc:velocity />
</mvc:view-resolution>
</beans>

View File

@@ -1,53 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="myViewResolver2"
class="org.springframework.web.servlet.view.InternalResourceViewResolver" >
<property name="prefix">
<value>/WEB-INF/pages/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<bean id="contentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
<property name="mediaTypes">
<value>
xml=application/rss+xml
</value>
</property>
</bean>
<mvc:view-resolution>
<mvc:content-negotiating manager="contentNegotiationManager" use-not-acceptable="true">
<mvc:default-views>
<bean class="org.springframework.web.servlet.view.json.MappingJackson2JsonView" />
</mvc:default-views>
</mvc:content-negotiating>
<mvc:jsp prefix="/WEB-INF/" suffix=".jsp" />
<mvc:bean-name />
<mvc:tiles definitions="/org/springframework/web/servlet/resource/tiles/tiles1.xml" />
<mvc:freemarker prefix="" suffix=".ftl" template-loader-paths="/" />
<mvc:velocity prefix="" suffix=".vm" resource-loader-path="/" />
<bean id="myViewResolver1" class="org.springframework.web.servlet.view.InternalResourceViewResolver" >
<property name="prefix">
<value>/WEB-INF/pages/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<ref bean="myViewResolver2" />
</mvc:view-resolution>
</beans>

View File

@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<mvc:annotation-driven content-negotiation-manager="contentNegotiationManager" />
<bean id="contentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!--
View resolution finds the ContentNegotiationManager created by or
registered with <mvc:annotation-driven>. Or in its absence simply declare it.
-->
<bean id="mvcContentNegotiationManager"
class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean"/>
<mvc:view-resolvers>
<mvc:content-negotiation use-not-acceptable="true">
<mvc:default-views>
<bean class="org.springframework.web.servlet.view.json.MappingJackson2JsonView" />
</mvc:default-views>
</mvc:content-negotiation>
<mvc:bean-name />
<mvc:jsp />
<mvc:tiles />
<mvc:freemarker />
<mvc:velocity />
</mvc:view-resolvers>
<mvc:tiles check-refresh="true">
<mvc:definitions location="/org/springframework/web/servlet/resource/tiles/tiles1.xml" />
</mvc:tiles>
<mvc:freemarker>
<mvc:template-loader-path location="/org/springframework/web/servlet/view" />
</mvc:freemarker>
<mvc:velocity resource-loader-path="/org/springframework/web/servlet/view" />
</beans>

View File

@@ -1,26 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<mvc:view-resolution>
<mvc:view-resolvers>
<mvc:bean-name />
<mvc:jsp view-class="org.springframework.web.servlet.view.InternalResourceView" />
<mvc:tiles />
<mvc:freemarker prefix="freemarker-" suffix=".freemarker" view-names="my*,*Report" />
<mvc:velocity cache-views="false" />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" />
<ref bean="customResolver" />
</mvc:view-resolvers>
<mvc:jsp prefix="/WEB-INF/" suffix=".jsp" />
<bean id="customResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" />
<mvc:bean-name />
<mvc:tiles check-refresh="true" validate-definitions="true">
<mvc:definitions location="/org/springframework/web/servlet/resource/tiles/tiles1.xml" />
<mvc:definitions location="/org/springframework/web/servlet/resource/tiles/tiles2.xml" />
</mvc:tiles>
<mvc:tiles definitions="/org/springframework/web/servlet/resource/tiles/tiles1.xml,/org/springframework/web/servlet/resource/tiles/tiles2.xml"
check-refresh="true" />
<mvc:freemarker>
<mvc:template-loader-path location="/" />
<mvc:template-loader-path location="/test" />
</mvc:freemarker>
<mvc:freemarker prefix="" suffix=".ftl"
template-loader-paths="/,/test" cache="false" />
<mvc:velocity resource-loader-path="/test" />
<mvc:velocity prefix="" suffix=".vm"
resource-loader-path="/" cache="false" />
</mvc:view-resolution>
</beans>