From a1aeed74b19ff960b557dfec1b494da18c79522e Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Tue, 19 Jun 2012 02:33:28 +0200 Subject: [PATCH] WIP: Versuch den StaticTest zu reparieren... --- examples/static/pom.xml | 1 + examples/static/src/main/webapp/WEB-INF/web.xml | 2 +- .../org/eclipse/jetty/servlet/DefaultServlet.java} | 5 +++-- examples/static/tomcat.sh | 11 ----------- 4 files changed, 5 insertions(+), 14 deletions(-) rename examples/static/src/{main/java/de/halbekunst/cachecontrol/examples/SimpleDefaultServlet.java => test/java/org/eclipse/jetty/servlet/DefaultServlet.java} (85%) delete mode 100755 examples/static/tomcat.sh diff --git a/examples/static/pom.xml b/examples/static/pom.xml index 9fe6d115..5cf0634f 100644 --- a/examples/static/pom.xml +++ b/examples/static/pom.xml @@ -19,6 +19,7 @@ org.apache.commons commons-io ${commons-io.version} + test diff --git a/examples/static/src/main/webapp/WEB-INF/web.xml b/examples/static/src/main/webapp/WEB-INF/web.xml index 89bf5915..d2fcb570 100644 --- a/examples/static/src/main/webapp/WEB-INF/web.xml +++ b/examples/static/src/main/webapp/WEB-INF/web.xml @@ -48,7 +48,7 @@ default - de.halbekunst.cachecontrol.examples.SimpleDefaultServlet + org.eclipse.jetty.servlet.DefaultServlet diff --git a/examples/static/src/main/java/de/halbekunst/cachecontrol/examples/SimpleDefaultServlet.java b/examples/static/src/test/java/org/eclipse/jetty/servlet/DefaultServlet.java similarity index 85% rename from examples/static/src/main/java/de/halbekunst/cachecontrol/examples/SimpleDefaultServlet.java rename to examples/static/src/test/java/org/eclipse/jetty/servlet/DefaultServlet.java index 6dff5ff8..0173a1fc 100644 --- a/examples/static/src/main/java/de/halbekunst/cachecontrol/examples/SimpleDefaultServlet.java +++ b/examples/static/src/test/java/org/eclipse/jetty/servlet/DefaultServlet.java @@ -1,4 +1,4 @@ -package de.halbekunst.cachecontrol.examples; +package org.eclipse.jetty.servlet; import java.io.FileInputStream; import java.io.IOException; @@ -13,7 +13,7 @@ import org.apache.commons.io.IOUtils; * * @author kai */ -public class SimpleDefaultServlet extends HttpServlet { +public class DefaultServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { @@ -22,6 +22,7 @@ public class SimpleDefaultServlet extends HttpServlet { response.sendError(HttpServletResponse.SC_NOT_FOUND); return; } + response.setContentType("text/html"); IOUtils.copy(new FileInputStream(path), response.getOutputStream()); } } diff --git a/examples/static/tomcat.sh b/examples/static/tomcat.sh deleted file mode 100755 index 4378a128..00000000 --- a/examples/static/tomcat.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/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