Add initial support for MVC namespace view resolution config
<mvc:view-resolution /> now allows to configure easily view resolvers. Issue: SPR-7093
This commit is contained in:
committed by
Rossen Stoyanchev
parent
b318880661
commit
92402e7715
@@ -0,0 +1,17 @@
|
||||
<?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-4.0.xsd
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<mvc:view-resolvers>
|
||||
<mvc:jsp prefix="/WEB-INF/" suffix=".jsp" />
|
||||
<mvc:bean-name />
|
||||
<mvc:tiles definitions="/tiles.xml" />
|
||||
|
||||
<mvc:freemarker prefix="" suffix=".ftl" templateLoaderPath="/WEB-INF/ftl/" />
|
||||
</mvc:view-resolvers>
|
||||
|
||||
</beans>
|
||||
|
||||
20
spring-webmvc/src/test/resources/tiles.xml
Normal file
20
spring-webmvc/src/test/resources/tiles.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE tiles-definitions PUBLIC
|
||||
"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
|
||||
"http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
|
||||
<tiles-definitions>
|
||||
<definition name="base.definition"
|
||||
template="/WEB-INF/jsp/layout.jsp">
|
||||
<put-attribute name="title" value="" />
|
||||
<put-attribute name="header" value="/WEB-INF/jsp/header.jsp" />
|
||||
<put-attribute name="menu" value="/WEB-INF/jsp/menu.jsp" />
|
||||
<put-attribute name="body" value="" />
|
||||
<put-attribute name="footer" value="/WEB-INF/jsp/footer.jsp" />
|
||||
</definition>
|
||||
|
||||
<definition name="contact" extends="base.definition">
|
||||
<put-attribute name="title" value="Contact Manager" />
|
||||
<put-attribute name="body" value="/WEB-INF/jsp/contact.jsp" />
|
||||
</definition>
|
||||
|
||||
</tiles-definitions>
|
||||
Reference in New Issue
Block a user