<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
<nextCatalog catalog="../.netbeans/6.9/var/cache/mavencachedirs/586500746/retriever/catalog.xml"/>
+ <nextCatalog catalog="../../.netbeans/6.9/var/cache/mavencachedirs/207239483/retriever/catalog.xml"/>
</catalog>
\ No newline at end of file
<constructor-arg value="3600"/>
</bean>
- <bean id="simpleUrlHandlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
- <property name="defaultHandler" value="urlFilenameViewController"/>
- </bean>
-
- <bean id="urlFilenameViewController" class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/>
-
- <!-- Resolves view names to protected .jsp resources within the /WEB-INF/views directory -->
- <bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
- <property name="prefix" value="/WEB-INF/views/"/>
- <property name="suffix" value=".jsp"/>
- </bean>
-
</beans>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>JSP Examples</title>
+ <link rel="stylesheet" type="text/css" media="all" href="/default.css">
+ </head>
+ <body>
+ <h1>JSP Examples</h1>
+ <ul>
+ <li><a href="/simple-page.jsp">A really simple JSP-page</a></li>
+ <li><a href="/page-with-include.jsp">A JSP-page with several includes</a></li>
+ <li><a href="/page-with-forward.jsp">A JSP-page with a forward to /simple-page.jsp</a></li>
+ </ul>
+ </body>
+</html>
+++ /dev/null
-<%@page contentType="text/html" pageEncoding="UTF-8" session="false" buffer="1kb" %>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>Simple Page</title>
- </head>
- <body>
- <h1>Simple Page</h1>
- <p>This page is a simple jsp-page</p>
- <p>At the same time, it gives an overview over all tests...</p>
- <ul>
- <li><a href="/index.jsp">A really simple JSP-page (this page!)</a></li>
- <li><a href="/page-with-include.jsp">A JSP-page with several includes</a></li>
- <li><a href="/page-with-forward.jsp">A JSP-page with a forward to /simple-page.jsp</a></li>
- </ul>
- </body>
-</html>
<body>
<h1>Hello World!</h1>
<p>This should not be seen, because the page is forwardes to /simple-page.jsp</p>
- <jsp:forward page="/index.jsp" />
+ <jsp:forward page="/simple-page.jsp" />
</body>
</html>
--- /dev/null
+<%@page contentType="text/html" pageEncoding="UTF-8" session="false" buffer="1kb" %>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Simple Page</title>
+ </head>
+ <body>
+ <h1>Simple Page</h1>
+ <p>This page is a simple jsp-page</p>
+ </body>
+</html>
--- /dev/null
+#!/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
--- /dev/null
+<?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-examples</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>juplo-examples-servlet</artifactId>
+ <packaging>war</packaging>
+ <name>Juplo - Examples: Servlet</name>
+
+</project>
--- /dev/null
+<?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/>
+
+ <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="1338593731"/>
+ </bean>
+
+ <bean id="cacheSeconds" class="java.lang.Integer">
+ <constructor-arg value="3600"/>
+ </bean>
+
+ <bean id="simpleUrlHandlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
+ <property name="defaultHandler" value="urlFilenameViewController"/>
+ </bean>
+
+ <bean id="urlFilenameViewController" class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/>
+
+ <!-- Resolves view names to protected .jsp resources within the /WEB-INF/views directory -->
+ <bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+ <property name="prefix" value="/WEB-INF/views/"/>
+ <property name="suffix" value=".jsp"/>
+ </bean>
+
+</beans>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%p - %C{1}.%M(%L) | %m%n"/>
+ </layout>
+ </appender>
+
+ <logger name="de.halbekunst">
+ <level value="trace"/>
+ </logger>
+
+ <root>
+ <level value="info"/>
+ <appender-ref ref="CONSOLE"/>
+ </root>
+
+</log4j:configuration>
--- /dev/null
+<?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-Definitions -->
+
+ <listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+
+
+ <!-- Filter-Definitions -->
+
+ <filter>
+ <filter-name>accelerator</filter-name>
+ <filter-class>de.halbekunst.juplo.cachecontrol.AcceleratorFilter</filter-class>
+ </filter>
+
+ <filter>
+ <filter-name>logger</filter-name>
+ <filter-class>de.halbekunst.juplo.test.LoggingHttpServletResponseFilter</filter-class>
+ </filter>
+
+
+ <!-- Filter-Mappings -->
+
+ <filter-mapping>
+ <filter-name>logger</filter-name>
+ <url-pattern>*.jsp</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>accelerator</filter-name>
+ <url-pattern>*.html</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>accelerator</filter-name>
+ <url-pattern>*.jsp</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>accelerator</filter-name>
+ <url-pattern>*.css</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>accelerator</filter-name>
+ <url-pattern>/test-servlet</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>accelerator</filter-name>
+ <url-pattern>/spring/*</url-pattern>
+ </filter-mapping>
+
+
+ <!-- Servlet-Definitions -->
+
+ <servlet>
+ <servlet-name>test-servlet</servlet-name>
+ <servlet-class>de.halbekunst.juplo.test.TestServlet</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>dispatcher-servlet</servlet-name>
+ <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+ <init-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>
+ </param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+
+ <!-- Servlet-Mappings -->
+
+ <servlet-mapping>
+ <servlet-name>test-servlet</servlet-name>
+ <url-pattern>/test-servlet</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>dispatcher-servlet</servlet-name>
+ <url-pattern>/spring/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Servlet Examples</title>
+ <link rel="stylesheet" type="text/css" media="all" href="/default.css">
+ </head>
+ <body>
+ <h1>Servlet Examples</h1>
+ <p>This page is a static HTML-page</p>
+ <ul>
+ <li><a href="/test-servlet">Empty Answer</a></li>
+ <li><a href="/test-servlet?n=16">16-Bytes-Answer</a></li>
+ <li><a href="/test-servlet?n=32">32-Bytes-Answer</a></li>
+ <li><a href="/test-servlet?n=64">64-Bytes-Answer</a></li>
+ <li><a href="/test-servlet?n=128">128-Bytes-Answer</a></li>
+ <li><a href="/test-servlet?n=256">256-Bytes-Answer</a></li>
+ <li><a href="/test-servlet?n=512">512-Bytes-Answer</a></li>
+ <li><a href="/test-servlet?n=1024">1024-Bytes-Answer</a></li>
+ <li><a href="/test-servlet?n=2048">2048-Bytes-Answer</a></li>
+ <li><a href="/test-servlet?n=4096">4096-Bytes-Answer</a></li>
+ <li><a href="/test-servlet?n=8192">8192-Bytes-Answer</a></li>
+ <li><a href="/test-servlet?n=16384">16384-Bytes-Answer</a></li>
+ </ul>
+ </body>
+</html>
--- /dev/null
+package de.halbekunst.cachecontrol.examples.jsp;
+
+import de.halbekunst.juplo.test.HttpTestCase;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author kai
+ */
+public class ServletTest extends HttpTestCase {
+
+ private static final Logger log = LoggerFactory.getLogger(ServletTest.class);
+
+
+ public ServletTest() {
+ super("src/main/webapp/WEB-INF/web.xml");
+ }
+
+
+ @Test
+ public void test() throws Exception {
+// WebResponse response = executeRequest("http://localhost:8080/simple-page.jsp");
+// log.info("Title:\t\t{}", response.getTitle());
+// log.debug("Text:\t\t{}", response.getText());
+ }
+}
--- /dev/null
+#!/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