Spring-Beispiel um eine View mit Controller erweitert
[percentcodec] / examples / spring / src / main / resources / config.xml
index b7a4892..f77073c 100644 (file)
@@ -2,9 +2,11 @@
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:mvc="http://www.springframework.org/schema/mvc"
        xsi:schemaLocation="
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
+           http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
 
   <!-- Activates the AspectJ-Weaver -->
   <context:component-scan base-package="de.halbekunst"/>
     <constructor-arg value="3600"/>
   </bean>
 
-  <bean id="simpleUrlHandlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
+  <!-- Configures the CacheControlInterceptor -->
+  <mvc:interceptors>
+    <bean class="de.halbekunst.juplo.cachecontrol.CacheControlInterceptor"/>
+  </mvc:interceptors>
+
+  <bean id="defaultAnnotationlHandlerMapping" class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
     <property name="defaultHandler" value="urlFilenameViewController"/>
   </bean>