From 1970ad566aa3df22aec7e3190a1fb0877f99a204 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 10 Jun 2012 21:36:53 +0200 Subject: [PATCH] WIP: Examples aufgeteilt --- .../servlet/src/main/webapp/WEB-INF/web.xml | 34 +------------ examples/static/jetty.sh | 11 +++++ examples/static/pom.xml | 17 +++++++ examples/static/src/main/resources/config.xml | 29 +++++++++++ examples/static/src/main/resources/log4j.xml | 21 ++++++++ .../static/src/main/webapp/WEB-INF/web.xml | 46 ++++++++++++++++++ examples/static/src/main/webapp/index.html | 16 ++++++ .../static/src/main/webapp/static/page.html | 13 +++++ .../src/main/webapp/static/stylesheets.css | 7 +++ .../examples/jsp/.JspTest.java.swp | Bin 0 -> 12288 bytes .../cachecontrol/examples/jsp/StaticTest.java | 28 +++++++++++ examples/static/tomcat.sh | 11 +++++ 12 files changed, 200 insertions(+), 33 deletions(-) create mode 100755 examples/static/jetty.sh create mode 100644 examples/static/pom.xml create mode 100644 examples/static/src/main/resources/config.xml create mode 100644 examples/static/src/main/resources/log4j.xml create mode 100644 examples/static/src/main/webapp/WEB-INF/web.xml create mode 100644 examples/static/src/main/webapp/index.html create mode 100644 examples/static/src/main/webapp/static/page.html create mode 100644 examples/static/src/main/webapp/static/stylesheets.css create mode 100644 examples/static/src/test/java/de/halbekunst/cachecontrol/examples/jsp/.JspTest.java.swp create mode 100644 examples/static/src/test/java/de/halbekunst/cachecontrol/examples/jsp/StaticTest.java create mode 100755 examples/static/tomcat.sh diff --git a/examples/servlet/src/main/webapp/WEB-INF/web.xml b/examples/servlet/src/main/webapp/WEB-INF/web.xml index 64cdaf70..53de033a 100644 --- a/examples/servlet/src/main/webapp/WEB-INF/web.xml +++ b/examples/servlet/src/main/webapp/WEB-INF/web.xml @@ -35,29 +35,13 @@ logger - *.jsp + /test-servlet - - accelerator - *.html - - - accelerator - *.jsp - - - accelerator - *.css - accelerator /test-servlet - - accelerator - /spring/* - @@ -67,17 +51,6 @@ de.halbekunst.juplo.test.TestServlet - - dispatcher-servlet - org.springframework.web.servlet.DispatcherServlet - - contextConfigLocation - - - - 1 - - @@ -86,9 +59,4 @@ /test-servlet - - dispatcher-servlet - /spring/* - - diff --git a/examples/static/jetty.sh b/examples/static/jetty.sh new file mode 100755 index 00000000..4950796b --- /dev/null +++ b/examples/static/jetty.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# + +# OutOfMemoryException beim "mvn jetty:run" umgehen und +# Parameter zum nachträglichen anhängen eines Debuggers +# setzen +export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m -XX:-UseGCOverheadLimit -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n" + +rm -v src/main/webapp/WEB-INF/lib/juplo* + +mvn jetty:run diff --git a/examples/static/pom.xml b/examples/static/pom.xml new file mode 100644 index 00000000..bbe5b9bc --- /dev/null +++ b/examples/static/pom.xml @@ -0,0 +1,17 @@ + + + + 4.0.0 + + + de.halbekunst + juplo-examples + 2.0-SNAPSHOT + + + juplo-examples-static + war + Juplo - Examples: Static Content + + diff --git a/examples/static/src/main/resources/config.xml b/examples/static/src/main/resources/config.xml new file mode 100644 index 00000000..e414ce93 --- /dev/null +++ b/examples/static/src/main/resources/config.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/static/src/main/resources/log4j.xml b/examples/static/src/main/resources/log4j.xml new file mode 100644 index 00000000..d3414bdb --- /dev/null +++ b/examples/static/src/main/resources/log4j.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/static/src/main/webapp/WEB-INF/web.xml b/examples/static/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..9e0b5040 --- /dev/null +++ b/examples/static/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,46 @@ + + + + + + + contextConfigLocation + classpath:/config.xml + + + + + + + org.springframework.web.context.ContextLoaderListener + + + + + + + accelerator + de.halbekunst.juplo.cachecontrol.AcceleratorFilter + + + + logger + de.halbekunst.juplo.test.LoggingHttpServletResponseFilter + + + + + + + logger + /static + + + + accelerator + /static + + + diff --git a/examples/static/src/main/webapp/index.html b/examples/static/src/main/webapp/index.html new file mode 100644 index 00000000..107f2473 --- /dev/null +++ b/examples/static/src/main/webapp/index.html @@ -0,0 +1,16 @@ + + + + + + Examples for Static Content + + + +

Examples for Static Content

+ + + diff --git a/examples/static/src/main/webapp/static/page.html b/examples/static/src/main/webapp/static/page.html new file mode 100644 index 00000000..f8517959 --- /dev/null +++ b/examples/static/src/main/webapp/static/page.html @@ -0,0 +1,13 @@ + + + + + + A Static Page + + + +

A Static Page

+

This page is a static HTML-page

+ + diff --git a/examples/static/src/main/webapp/static/stylesheets.css b/examples/static/src/main/webapp/static/stylesheets.css new file mode 100644 index 00000000..e04bba27 --- /dev/null +++ b/examples/static/src/main/webapp/static/stylesheets.css @@ -0,0 +1,7 @@ +body { + background-color: #ccc; + color: #444; +} +h1,h2,h3,h4 { + color: #000; +} \ No newline at end of file diff --git a/examples/static/src/test/java/de/halbekunst/cachecontrol/examples/jsp/.JspTest.java.swp b/examples/static/src/test/java/de/halbekunst/cachecontrol/examples/jsp/.JspTest.java.swp new file mode 100644 index 0000000000000000000000000000000000000000..765075a60349a8bd8c56d3cf60652c489e8af456 GIT binary patch literal 12288 zcmeI2+iDX*7{{mTjXjE93u9DBi`lJJu(Vi;rLonX=<%iqlg%XAbh5MV%(l@|3kAVD z^$oo80R%zt4ZP4N&va5msg?|!djqL0<%WA!?hV}?bS`dY zZt!bYSI)f_5N9 z43GgbKnBPF86X2>fDDiUGC&4Sp#f23OkHMdp%a70|NjTy|9|u`_8oixDR>4Z!EJC0 zaBv;;f==+Om$9GVJ$MJ+f|ptOTuZZCdSOtr~#WWA-AOmE843GgbKnBPF8Tfw&b{OXl&Xq2E zMOjG8+03%6+mUsJdgIjSitz@`xU;s?}vp78aYA zYh9N=3b5HseydYa)#NEm;t8?5|Be%1zJZUD2!8RNHK8CUWBr+t`;lkCSjySjkOe_3=^| z3B_l08TsXIQ^E4yFXTmFb@IY(Bl{<^2Pxr!62@Rfv*v={+MU-jAsFnUydTSYaELhHHvwN3}R z=GCN?ZV^h)?NN<3hxW8qQ_Rr6N%3AIhu(8Lly^7?7qAF6@U(b)`@>1}-a+cUd+MX? E4;!>M4FCWD literal 0 HcmV?d00001 diff --git a/examples/static/src/test/java/de/halbekunst/cachecontrol/examples/jsp/StaticTest.java b/examples/static/src/test/java/de/halbekunst/cachecontrol/examples/jsp/StaticTest.java new file mode 100644 index 00000000..66a2826a --- /dev/null +++ b/examples/static/src/test/java/de/halbekunst/cachecontrol/examples/jsp/StaticTest.java @@ -0,0 +1,28 @@ +package de.halbekunst.cachecontrol.examples.jsp; + +import de.halbekunst.juplo.test.HttpTestCase; +import com.meterware.httpunit.WebResponse; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author kai + */ +public class StaticTest extends HttpTestCase { + + private static final Logger log = LoggerFactory.getLogger(StaticTest.class); + + + public StaticTest() { + super("src/main/webapp/WEB-INF/web.xml"); + } + + @Test + public void testStaticContent() throws Exception { + WebResponse response = executeRequest("http://localhost:8080/default.css"); + log.info("Title:\t\t{}", response.getTitle()); + log.debug("Text:\t\t{}", response.getText()); + } +} diff --git a/examples/static/tomcat.sh b/examples/static/tomcat.sh new file mode 100755 index 00000000..4378a128 --- /dev/null +++ b/examples/static/tomcat.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# + +# OutOfMemoryException beim "mvn jetty:run" umgehen und +# Parameter zum nachträglichen anhängen eines Debuggers +# setzen +export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m -XX:-UseGCOverheadLimit -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n" + +rm -v src/main/webapp/WEB-INF/lib/juplo* + +mvn tomcat:run-war -- 2.20.1