<version>2.0-SNAPSHOT</version>
</parent>
- <artifactId>${pom.parent.artifactId}-jsp</artifactId>
+ <artifactId>juplo-examples-jsp</artifactId>
<packaging>war</packaging>
<name>Juplo - Examples: JSP-Pages</name>
+++ /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>
- <link rel="stylesheet" type="text/css" media="all" href="/default.css">
- </head>
- <body>
- <h1>Hello World!</h1>
- <p>This is a really simple page...</p>
- <p>This version of a really simple page was delivered via SPRING!</p>
- </body>
-</html>
<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
-body {
- background-color: #ccc;
- color: #444;
-}
-h1,h2,h3,h4 {
- color: #000;
-}
\ No newline at end of file
+++ /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>Static Page</title>
- <link rel="stylesheet" type="text/css" media="all" href="/default.css">
- </head>
- <body>
- <h1>Static Page</h1>
- <p>This page is a static HTML-page</p>
- <p>At the same time, it gives an overview over all tests...</p>
- <h2>JSP-Pages</h2>
- <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>
- <h2>Static Content</h2>
- <ul>
- <li><a href="/index.html">A plain static HTML-file (this page!)</a></li>
- <li><a href="/default.css">A plain static CSS-file</a></li>
- </ul>
- <h2>Dynamic Servlet-Answers</h2>
- <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
+<%@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="/simple-page.jsp" />
+ <jsp:forward page="/index.jsp" />
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Page with include</title>
- <link rel="stylesheet" type="text/css" media="all" href="/default.css">
</head>
<body>
<h1>Hello World!</h1>
+++ /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>
- <link rel="stylesheet" type="text/css" media="all" href="/default.css">
- </head>
- <body>
- <h1>Hello World!</h1>
- <p>This is a really simple page...</p>
- </body>
-</html>
@Test
public void testSimplePage() throws Exception {
- WebResponse response = executeRequest("http://localhost:8080/simple-page.jsp");
+ WebResponse response = executeRequest("http://localhost:8080/index.jsp");
log.info("Title:\t\t{}", response.getTitle());
log.debug("Text:\t\t{}", response.getText());
}
log.info("Title:\t\t{}", response.getTitle());
log.debug("Text:\t\t{}", response.getText());
}
-
- @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());
- }
}
<modules>
<module>jsp</module>
+ <module>static</module>
+ <module>servlet</module>
+ <module>spring</module>
</modules>
<dependencies>
<scope>runtime</scope>
</dependency>
-
<!-- Test -->
<dependency>
<groupId>${pom.parent.groupId}</groupId>