Spring eingef├╝hrt, um die Tiles-Konfiguration zu vereinfachen
[website] / src / main / webapp / WEB-INF / spring / mvc.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns="http://www.springframework.org/schema/beans"
3        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4        xmlns:mvc="http://www.springframework.org/schema/mvc"
5        xsi:schemaLocation="
6            http://www.springframework.org/schema/beans
7            http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
8            http://www.springframework.org/schema/mvc
9            http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
10            ">
11
12   <!-- Damit das DispatcherServlet auf /* gemappt werden kann -->
13   <mvc:default-servlet-handler/>
14   <mvc:view-controller path="/" view-name="index"/>
15
16   <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
17     <property name="mappings">
18       <value>
19         /*.html=urlFilenameViewController
20         /**/*.html=urlFilenameViewController
21       </value>
22     </property>
23     <property name="order" value="10"/>
24   </bean>
25   <bean id="urlFilenameViewController" class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/>
26
27   <!-- Tiles View-Resolver -->
28   <bean class="org.springframework.web.servlet.view.tiles3.TilesViewResolver"/>
29
30   <!-- Resolves view names to protected .jsp resources within the /WEB-INF/views directory -->
31   <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
32     <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
33     <property name="prefix" value="/WEB-INF/views/"/>
34     <property name="suffix" value=".jsp"/>
35   </bean>
36
37   <bean class="org.springframework.web.servlet.view.tiles3.TilesConfigurer">
38     <property name="definitions">
39       <list>
40         <value>/WEB-INF/spring/tiles.xml</value>
41       </list>
42     </property>
43     <property name="useMutableTilesContainer" value="true"/>
44   </bean>
45
46 </beans>