Spring-Beispiel um eine View mit Controller erweitert
authorKai Moritz <kai@coolibri.de>
Thu, 2 Aug 2012 06:52:28 +0000 (08:52 +0200)
committerKai Moritz <kai@coolibri.de>
Thu, 2 Aug 2012 07:03:27 +0000 (09:03 +0200)
examples/pom.xml
examples/spring/pom.xml
examples/spring/src/main/resources/config.xml

index cf45de5..1905f52 100644 (file)
@@ -28,7 +28,6 @@
       <groupId>${pom.parent.groupId}</groupId>
       <artifactId>juplo-cachecontrol</artifactId>
       <version>${pom.parent.version}</version>
-      <scope>runtime</scope>
     </dependency>
 
     <!-- JSP-Stuff... -->
index 90010cc..b6924e4 100644 (file)
   <packaging>war</packaging>
   <name>Juplo - Examples: Spring-MVC</name>
 
+  <dependencies>
+
+    <!--  Spring -->
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context</artifactId>
+      <version>${springframework.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-web</artifactId>
+      <version>${springframework.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-webmvc</artifactId>
+      <version>${springframework.version}</version>
+    </dependency>
+
+  </dependencies>
+
 </project>
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>