Modul mit Beispiel-Konfigurationen für den Einsatz von juplo-cachecontrol
authorKai Moritz <kai@coolibri.de>
Fri, 23 Dec 2011 17:16:06 +0000 (18:16 +0100)
committerKai Moritz <kai@coolibri.de>
Thu, 2 Aug 2012 07:03:25 +0000 (09:03 +0200)
cachecontrol-examples/pom.xml [new file with mode: 0644]
cachecontrol-examples/src/main/resources/config.xml [new file with mode: 0644]
cachecontrol-examples/src/main/webapp/WEB-INF/web.xml [new file with mode: 0644]
pom.xml

diff --git a/cachecontrol-examples/pom.xml b/cachecontrol-examples/pom.xml
new file mode 100644 (file)
index 0000000..b9ff443
--- /dev/null
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>de.halbekunst</groupId>
+    <artifactId>juplo</artifactId>
+    <version>2.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>${pom.parent.artifactId}-cachecontrol-examples</artifactId>
+  <name>Juplo - CacheControl - Examples</name>
+
+  <dependencies>
+
+    <dependency>
+      <groupId>${pom.parent.groupId}</groupId>
+      <artifactId>${pom.parent.artifactId}-cachecontrol</artifactId>
+      <version>${pom.parent.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>${pom.parent.groupId}</groupId>
+      <artifactId>${pom.parent.artifactId}-test</artifactId>
+      <version>${pom.parent.version}</version>
+    </dependency>
+
+    <!--  Spring -->
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context</artifactId>
+      <version>${springframework.version}</version>
+      <scope>runtime</scope>
+      <exclusions>
+        <!-- Exclude Commons Logging in favor of SLF4j -->
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-aspects</artifactId>
+      <version>${springframework.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.aspectj</groupId>
+      <artifactId>aspectjrt</artifactId>
+      <version>${aspectj.version}</version>
+    </dependency>
+
+    <!-- Servlet
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>${servlet-api.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet.jsp</groupId>
+      <artifactId>jsp-api</artifactId>
+      <version>${jsp-api.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>jstl</artifactId>
+      <version>${jstl.version}</version>
+    </dependency>
+    -->
+
+    <!-- Other stuff
+    <dependency>
+      <groupId>org.aspectj</groupId>
+      <artifactId>aspectjweaver</artifactId>
+      <version>${aspectj.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    -->
+
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.mortbay.jetty</groupId>
+        <artifactId>jetty-maven-plugin</artifactId>
+        <version>8.0.1.v20110908</version>
+        <configuration>
+          <connectors>
+            <connector implementation="org.eclipse.jetty.server.nio.BlockingChannelConnector">
+              <host>0.0.0.0</host>
+              <port>8080</port>
+              <acceptors>2</acceptors>
+            </connector>
+          </connectors>
+          <scanIntervalSeconds>0</scanIntervalSeconds>
+          <scanTargetPatterns>
+            <scanTargetPattern>
+              <directory>${project.basedir}/src/main/webapp/WEB-INF</directory>
+              <excludes>
+                <exclude>**/*.jsp</exclude>
+              </excludes>
+              <includes>
+                <include>**/*.properties</include>
+                <include>**/*.xml</include>
+              </includes>
+            </scanTargetPattern>
+          </scanTargetPatterns>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>tomcat-maven-plugin</artifactId>
+        <version>1.1</version>
+        <configuration>
+          <path>/</path>
+          <uriEncoding>UTF-8</uriEncoding>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>aspectj-maven-plugin</artifactId>
+        <configuration>
+          <complianceLevel>1.6</complianceLevel>
+          <aspectLibraries>
+            <aspectLibrary>
+              <groupId>org.springframework</groupId>
+              <artifactId>spring-aspects</artifactId>
+            </aspectLibrary>
+          </aspectLibraries>
+          <weaveDependencies>
+            <weaveDependency>
+              <groupId>${pom.parent.groupId}</groupId>
+              <artifactId>${pom.parent.artifactId}-cachecontrol</artifactId>
+            </weaveDependency>
+          </weaveDependencies>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>compile</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
diff --git a/cachecontrol-examples/src/main/resources/config.xml b/cachecontrol-examples/src/main/resources/config.xml
new file mode 100644 (file)
index 0000000..33382bd
--- /dev/null
@@ -0,0 +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:context="http://www.springframework.org/schema/context"
+       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">
+
+  <!-- Activates the AspectJ-Weaver -->
+  <context:component-scan base-package="de.halbekunst"/>
+  <context:spring-configured/>
+  <!--<context:load-time-weaver/>-->
+
+  <bean id="buffer" class="java.lang.Integer">
+    <constructor-arg value="1024"/>
+  </bean>
+
+  <bean id="eTag" class="java.lang.String">
+    <constructor-arg value="Hallo Welt!"/>
+  </bean>
+
+  <bean id="weak" class="java.lang.Boolean">
+    <constructor-arg value="true"/>
+  </bean>
+
+  <bean id="lastModified" class="java.lang.Long">
+    <constructor-arg value="0"/>
+  </bean>
+
+  <bean id="cacheSeconds" class="java.lang.Integer">
+    <constructor-arg value="3600"/>
+  </bean>
+
+</beans>
diff --git a/cachecontrol-examples/src/main/webapp/WEB-INF/web.xml b/cachecontrol-examples/src/main/webapp/WEB-INF/web.xml
new file mode 100644 (file)
index 0000000..21299ff
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+  <!-- Context Configuration locations for Spring XML files -->
+  <context-param>
+    <param-name>contextConfigLocation</param-name>
+    <param-value>classpath:/config.xml</param-value>
+  </context-param>
+
+  <listener>
+    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+  </listener>
+
+  <filter>
+    <filter-name>accelerator</filter-name>
+    <filter-class>de.halbekunst.juplo.cachecontrol.AcceleratorFilter</filter-class>
+  </filter>
+
+  <filter-mapping>
+    <filter-name>accelerator</filter-name>
+    <url-pattern>/*</url-pattern>
+  </filter-mapping>
+
+  <servlet>
+    <servlet-name>test-servlet</servlet-name>
+    <servlet-class>de.halbekunst.juplo.test.TestServlet</servlet-class>
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>test-servlet</servlet-name>
+    <url-pattern>/*</url-pattern>
+  </servlet-mapping>
+
+</web-app>
diff --git a/pom.xml b/pom.xml
index 4c1bc81..4583d12 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -26,6 +26,7 @@
   <modules>
     <module>test</module>
     <module>cachecontrol</module>
+    <module>cachecontrol-examples</module>
   </modules>
 
   <properties>