From: Kai Moritz Date: Sat, 2 Jun 2012 23:45:42 +0000 (+0200) Subject: Benennung und Ordnung der Beispiel-Module überarbeitet X-Git-Url: https://juplo.de/gitweb/?p=percentcodec;a=commitdiff_plain;h=e7c72fc7ecbc9211a6f97c7869ba3439cf4fa33f Benennung und Ordnung der Beispiel-Module überarbeitet --- diff --git a/cachecontrol-example-jsp/jetty.sh b/cachecontrol-example-jsp/jetty.sh deleted file mode 100755 index 4950796b..00000000 --- a/cachecontrol-example-jsp/jetty.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 jetty:run diff --git a/cachecontrol-example-jsp/pom.xml b/cachecontrol-example-jsp/pom.xml deleted file mode 100644 index 1b78cb5e..00000000 --- a/cachecontrol-example-jsp/pom.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - - 4.0.0 - - - de.halbekunst - juplo - 2.0-SNAPSHOT - - - ${pom.parent.artifactId}-cachecontrol-example-jsp - war - Juplo - CacheControl - Examples: JSP-Page - - - - - - ${pom.parent.groupId} - ${pom.parent.artifactId}-cachecontrol - ${pom.parent.version} - runtime - - - - - javax.servlet - jstl - ${jstl.version} - runtime - - - - - org.springframework - spring-webmvc - ${springframework.version} - runtime - - - org.springframework - spring-context - ${springframework.version} - runtime - - - - commons-logging - commons-logging - - - - - org.springframework - spring-aspects - ${springframework.version} - runtime - - - org.aspectj - aspectjrt - ${aspectj.version} - runtime - - - - - org.slf4j - ${slf4j.binding} - ${slf4j.version} - runtime - - - - - - ${pom.parent.groupId} - ${pom.parent.artifactId}-test - ${pom.parent.version} - - - org.apache.tomcat - jasper - ${jasper.version} - test - - - - - - - - org.mortbay.jetty - jetty-maven-plugin - 8.0.1.v20110908 - - - - 0.0.0.0 - 8080 - 2 - - - 0 - - - ${project.basedir}/src/main/webapp/WEB-INF - - **/*.jsp - - - **/*.properties - **/*.xml - - - - - - - org.codehaus.mojo - tomcat-maven-plugin - 1.1 - - / - UTF-8 - - - - - - diff --git a/cachecontrol-example-jsp/src/main/resources/config.xml b/cachecontrol-example-jsp/src/main/resources/config.xml deleted file mode 100644 index b7a4892e..00000000 --- a/cachecontrol-example-jsp/src/main/resources/config.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cachecontrol-example-jsp/src/main/resources/log4j.xml b/cachecontrol-example-jsp/src/main/resources/log4j.xml deleted file mode 100644 index d3414bdb..00000000 --- a/cachecontrol-example-jsp/src/main/resources/log4j.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/cachecontrol-example-jsp/src/main/webapp/WEB-INF/c.tld b/cachecontrol-example-jsp/src/main/webapp/WEB-INF/c.tld deleted file mode 100644 index 8c447f59..00000000 --- a/cachecontrol-example-jsp/src/main/webapp/WEB-INF/c.tld +++ /dev/null @@ -1,572 +0,0 @@ - - - - - JSTL 1.1 core library - JSTL core - 1.1 - c - http://java.sun.com/jsp/jstl/core - - - - Provides core validation features for JSTL tags. - - - org.apache.taglibs.standard.tlv.JstlCoreTLV - - - - - - Catches any Throwable that occurs in its body and optionally - exposes it. - - catch - org.apache.taglibs.standard.tag.common.core.CatchTag - JSP - - -Name of the exported scoped variable for the -exception thrown from a nested action. The type of the -scoped variable is the type of the exception thrown. - - var - false - false - - - - - - Simple conditional tag that establishes a context for - mutually exclusive conditional operations, marked by - <when> and <otherwise> - - choose - org.apache.taglibs.standard.tag.common.core.ChooseTag - JSP - - - - - Simple conditional tag, which evalutes its body if the - supplied condition is true and optionally exposes a Boolean - scripting variable representing the evaluation of this condition - - if - org.apache.taglibs.standard.tag.rt.core.IfTag - JSP - - -The test condition that determines whether or -not the body content should be processed. - - test - true - true - boolean - - - -Name of the exported scoped variable for the -resulting value of the test condition. The type -of the scoped variable is Boolean. - - var - false - false - - - -Scope for var. - - scope - false - false - - - - - - Retrieves an absolute or relative URL and exposes its contents - to either the page, a String in 'var', or a Reader in 'varReader'. - - import - org.apache.taglibs.standard.tag.rt.core.ImportTag - org.apache.taglibs.standard.tei.ImportTEI - JSP - - -The URL of the resource to import. - - url - true - true - - - -Name of the exported scoped variable for the -resource's content. The type of the scoped -variable is String. - - var - false - false - - - -Scope for var. - - scope - false - false - - - -Name of the exported scoped variable for the -resource's content. The type of the scoped -variable is Reader. - - varReader - false - false - - - -Name of the context when accessing a relative -URL resource that belongs to a foreign -context. - - context - false - true - - - -Character encoding of the content at the input -resource. - - charEncoding - false - true - - - - - - The basic iteration tag, accepting many different - collection types and supporting subsetting and other - functionality - - forEach - org.apache.taglibs.standard.tag.rt.core.ForEachTag - org.apache.taglibs.standard.tei.ForEachTEI - JSP - - -Collection of items to iterate over. - - items - false - true - java.lang.Object - - java.lang.Object - - - - -If items specified: -Iteration begins at the item located at the -specified index. First item of the collection has -index 0. -If items not specified: -Iteration begins with index set at the value -specified. - - begin - false - true - int - - - -If items specified: -Iteration ends at the item located at the -specified index (inclusive). -If items not specified: -Iteration ends when index reaches the value -specified. - - end - false - true - int - - - -Iteration will only process every step items of -the collection, starting with the first one. - - step - false - true - int - - - -Name of the exported scoped variable for the -current item of the iteration. This scoped -variable has nested visibility. Its type depends -on the object of the underlying collection. - - var - false - false - - - -Name of the exported scoped variable for the -status of the iteration. Object exported is of type -javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested -visibility. - - varStatus - false - false - - - - - - Iterates over tokens, separated by the supplied delimeters - - forTokens - org.apache.taglibs.standard.tag.rt.core.ForTokensTag - JSP - - -String of tokens to iterate over. - - items - true - true - java.lang.String - - java.lang.String - - - - -The set of delimiters (the characters that -separate the tokens in the string). - - delims - true - true - java.lang.String - - - -Iteration begins at the token located at the -specified index. First token has index 0. - - begin - false - true - int - - - -Iteration ends at the token located at the -specified index (inclusive). - - end - false - true - int - - - -Iteration will only process every step tokens -of the string, starting with the first one. - - step - false - true - int - - - -Name of the exported scoped variable for the -current item of the iteration. This scoped -variable has nested visibility. - - var - false - false - - - -Name of the exported scoped variable for the -status of the iteration. Object exported is of -type -javax.servlet.jsp.jstl.core.LoopTag -Status. This scoped variable has nested -visibility. - - varStatus - false - false - - - - - - Like <%= ... >, but for expressions. - - out - org.apache.taglibs.standard.tag.rt.core.OutTag - JSP - - -Expression to be evaluated. - - value - true - true - - - -Default value if the resulting value is null. - - default - false - true - - - -Determines whether characters <,>,&,'," in the -resulting string should be converted to their -corresponding character entity codes. Default value is -true. - - escapeXml - false - true - - - - - - - Subtag of <choose> that follows <when> tags - and runs only if all of the prior conditions evaluated to - 'false' - - otherwise - org.apache.taglibs.standard.tag.common.core.OtherwiseTag - JSP - - - - - Adds a parameter to a containing 'import' tag's URL. - - param - org.apache.taglibs.standard.tag.rt.core.ParamTag - JSP - - -Name of the query string parameter. - - name - true - true - - - -Value of the parameter. - - value - false - true - - - - - - Redirects to a new URL. - - redirect - org.apache.taglibs.standard.tag.rt.core.RedirectTag - JSP - - -The URL of the resource to redirect to. - - url - false - true - - - -Name of the context when redirecting to a relative URL -resource that belongs to a foreign context. - - context - false - true - - - - - - Removes a scoped variable (from a particular scope, if specified). - - remove - org.apache.taglibs.standard.tag.common.core.RemoveTag - empty - - -Name of the scoped variable to be removed. - - var - true - false - - - -Scope for var. - - scope - false - false - - - - - - Sets the result of an expression evaluation in a 'scope' - - set - org.apache.taglibs.standard.tag.rt.core.SetTag - JSP - - -Name of the exported scoped variable to hold the value -specified in the action. The type of the scoped variable is -whatever type the value expression evaluates to. - - var - false - false - - - -Expression to be evaluated. - - value - false - true - - java.lang.Object - - - - -Target object whose property will be set. Must evaluate to -a JavaBeans object with setter property property, or to a -java.util.Map object. - - target - false - true - - - -Name of the property to be set in the target object. - - property - false - true - - - -Scope for var. - - scope - false - false - - - - - - Creates a URL with optional query parameters. - - url - org.apache.taglibs.standard.tag.rt.core.UrlTag - JSP - - -Name of the exported scoped variable for the -processed url. The type of the scoped variable is -String. - - var - false - false - - - -Scope for var. - - scope - false - false - - - -URL to be processed. - - value - false - true - - - -Name of the context when specifying a relative URL -resource that belongs to a foreign context. - - context - false - true - - - - - - Subtag of <choose> that includes its body if its - condition evalutes to 'true' - - when - org.apache.taglibs.standard.tag.rt.core.WhenTag - JSP - - -The test condition that determines whether or not the -body content should be processed. - - test - true - true - boolean - - - - diff --git a/cachecontrol-example-jsp/src/main/webapp/WEB-INF/included.jsp b/cachecontrol-example-jsp/src/main/webapp/WEB-INF/included.jsp deleted file mode 100644 index 1931d893..00000000 --- a/cachecontrol-example-jsp/src/main/webapp/WEB-INF/included.jsp +++ /dev/null @@ -1,2 +0,0 @@ -<%@page contentType="text/html" pageEncoding="UTF-8" session="false"%> -

Hello World, again...

diff --git a/cachecontrol-example-jsp/src/main/webapp/WEB-INF/views/simple-page.jsp b/cachecontrol-example-jsp/src/main/webapp/WEB-INF/views/simple-page.jsp deleted file mode 100644 index 194cac5b..00000000 --- a/cachecontrol-example-jsp/src/main/webapp/WEB-INF/views/simple-page.jsp +++ /dev/null @@ -1,15 +0,0 @@ -<%@page contentType="text/html" pageEncoding="UTF-8" session="false" buffer="1kb" %> - - - - - - Simple Page - - - -

Hello World!

-

This is a really simple page...

-

This version of a really simple page was delivered via SPRING!

- - diff --git a/cachecontrol-example-jsp/src/main/webapp/WEB-INF/web.xml b/cachecontrol-example-jsp/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 64cdaf70..00000000 --- a/cachecontrol-example-jsp/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - contextConfigLocation - classpath:/config.xml - - - - - - - org.springframework.web.context.ContextLoaderListener - - - - - - - accelerator - de.halbekunst.juplo.cachecontrol.AcceleratorFilter - - - - logger - de.halbekunst.juplo.test.LoggingHttpServletResponseFilter - - - - - - - logger - *.jsp - - - - accelerator - *.html - - - accelerator - *.jsp - - - accelerator - *.css - - - accelerator - /test-servlet - - - accelerator - /spring/* - - - - - - - test-servlet - de.halbekunst.juplo.test.TestServlet - - - - dispatcher-servlet - org.springframework.web.servlet.DispatcherServlet - - contextConfigLocation - - - - 1 - - - - - - - test-servlet - /test-servlet - - - - dispatcher-servlet - /spring/* - - - diff --git a/cachecontrol-example-jsp/src/main/webapp/default.css b/cachecontrol-example-jsp/src/main/webapp/default.css deleted file mode 100644 index e04bba27..00000000 --- a/cachecontrol-example-jsp/src/main/webapp/default.css +++ /dev/null @@ -1,7 +0,0 @@ -body { - background-color: #ccc; - color: #444; -} -h1,h2,h3,h4 { - color: #000; -} \ No newline at end of file diff --git a/cachecontrol-example-jsp/src/main/webapp/index.html b/cachecontrol-example-jsp/src/main/webapp/index.html deleted file mode 100644 index cd95f2c5..00000000 --- a/cachecontrol-example-jsp/src/main/webapp/index.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Static Page - - - -

Static Page

-

This page is a static HTML-page

-

At the same time, it gives an overview over all tests...

-

JSP-Pages

- -

Static Content

- -

Dynamic Servlet-Answers

- - - diff --git a/cachecontrol-example-jsp/src/main/webapp/page-with-forward.jsp b/cachecontrol-example-jsp/src/main/webapp/page-with-forward.jsp deleted file mode 100644 index 35e49058..00000000 --- a/cachecontrol-example-jsp/src/main/webapp/page-with-forward.jsp +++ /dev/null @@ -1,14 +0,0 @@ -<%@page contentType="text/html" pageEncoding="UTF-8" session="false" buffer="1kb" %> - - - - - - Page with forward - - -

Hello World!

-

This should not be seen, because the page is forwardes to /simple-page.jsp

- - - diff --git a/cachecontrol-example-jsp/src/main/webapp/page-with-include.jsp b/cachecontrol-example-jsp/src/main/webapp/page-with-include.jsp deleted file mode 100644 index ba581a46..00000000 --- a/cachecontrol-example-jsp/src/main/webapp/page-with-include.jsp +++ /dev/null @@ -1,15 +0,0 @@ -<%@page contentType="text/html" pageEncoding="UTF-8" session="false" buffer="1kb" %> -<%@taglib uri="/WEB-INF/c.tld" prefix="c"%> - - - - - - Page with include - - - -

Hello World!

- ${i}: - - diff --git a/cachecontrol-example-jsp/src/main/webapp/simple-page.jsp b/cachecontrol-example-jsp/src/main/webapp/simple-page.jsp deleted file mode 100644 index 880d7611..00000000 --- a/cachecontrol-example-jsp/src/main/webapp/simple-page.jsp +++ /dev/null @@ -1,14 +0,0 @@ -<%@page contentType="text/html" pageEncoding="UTF-8" session="false" buffer="1kb" %> - - - - - - Simple Page - - - -

Hello World!

-

This is a really simple page...

- - diff --git a/cachecontrol-example-jsp/src/test/java/de/halbekunst/cachecontrol/examples/jsp/JspTest.java b/cachecontrol-example-jsp/src/test/java/de/halbekunst/cachecontrol/examples/jsp/JspTest.java deleted file mode 100644 index 9861068b..00000000 --- a/cachecontrol-example-jsp/src/test/java/de/halbekunst/cachecontrol/examples/jsp/JspTest.java +++ /dev/null @@ -1,50 +0,0 @@ -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 JspTest extends HttpTestCase { - - private static final Logger log = LoggerFactory.getLogger(JspTest.class); - - - public JspTest() { - super("src/main/webapp/WEB-INF/web.xml"); - } - - - @Test - public void testSimplePage() 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()); - } - - @Test - public void testPageWithInclude() throws Exception { - WebResponse response = executeRequest("http://localhost:8080/page-with-include.jsp"); - log.info("Title:\t\t{}", response.getTitle()); - log.debug("Text:\t\t{}", response.getText()); - } - - @Test - public void testPageWithForward() throws Exception { - WebResponse response = executeRequest("http://localhost:8080/page-with-forward.jsp"); - 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()); - } -} diff --git a/cachecontrol-example-jsp/tomcat.sh b/cachecontrol-example-jsp/tomcat.sh deleted file mode 100755 index 4378a128..00000000 --- a/cachecontrol-example-jsp/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 diff --git a/examples/jsp/catalog.xml b/examples/jsp/catalog.xml new file mode 100644 index 00000000..218f47c2 --- /dev/null +++ b/examples/jsp/catalog.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/examples/jsp/jetty.sh b/examples/jsp/jetty.sh new file mode 100755 index 00000000..4950796b --- /dev/null +++ b/examples/jsp/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/jsp/pom.xml b/examples/jsp/pom.xml new file mode 100644 index 00000000..d9f3c6a2 --- /dev/null +++ b/examples/jsp/pom.xml @@ -0,0 +1,17 @@ + + + + 4.0.0 + + + de.halbekunst + juplo-examples + 2.0-SNAPSHOT + + + ${pom.parent.artifactId}-jsp + war + Juplo - Examples: JSP-Pages + + diff --git a/examples/jsp/src/main/resources/config.xml b/examples/jsp/src/main/resources/config.xml new file mode 100644 index 00000000..b7a4892e --- /dev/null +++ b/examples/jsp/src/main/resources/config.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/jsp/src/main/resources/log4j.xml b/examples/jsp/src/main/resources/log4j.xml new file mode 100644 index 00000000..d3414bdb --- /dev/null +++ b/examples/jsp/src/main/resources/log4j.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/jsp/src/main/webapp/WEB-INF/c.tld b/examples/jsp/src/main/webapp/WEB-INF/c.tld new file mode 100644 index 00000000..8c447f59 --- /dev/null +++ b/examples/jsp/src/main/webapp/WEB-INF/c.tld @@ -0,0 +1,572 @@ + + + + + JSTL 1.1 core library + JSTL core + 1.1 + c + http://java.sun.com/jsp/jstl/core + + + + Provides core validation features for JSTL tags. + + + org.apache.taglibs.standard.tlv.JstlCoreTLV + + + + + + Catches any Throwable that occurs in its body and optionally + exposes it. + + catch + org.apache.taglibs.standard.tag.common.core.CatchTag + JSP + + +Name of the exported scoped variable for the +exception thrown from a nested action. The type of the +scoped variable is the type of the exception thrown. + + var + false + false + + + + + + Simple conditional tag that establishes a context for + mutually exclusive conditional operations, marked by + <when> and <otherwise> + + choose + org.apache.taglibs.standard.tag.common.core.ChooseTag + JSP + + + + + Simple conditional tag, which evalutes its body if the + supplied condition is true and optionally exposes a Boolean + scripting variable representing the evaluation of this condition + + if + org.apache.taglibs.standard.tag.rt.core.IfTag + JSP + + +The test condition that determines whether or +not the body content should be processed. + + test + true + true + boolean + + + +Name of the exported scoped variable for the +resulting value of the test condition. The type +of the scoped variable is Boolean. + + var + false + false + + + +Scope for var. + + scope + false + false + + + + + + Retrieves an absolute or relative URL and exposes its contents + to either the page, a String in 'var', or a Reader in 'varReader'. + + import + org.apache.taglibs.standard.tag.rt.core.ImportTag + org.apache.taglibs.standard.tei.ImportTEI + JSP + + +The URL of the resource to import. + + url + true + true + + + +Name of the exported scoped variable for the +resource's content. The type of the scoped +variable is String. + + var + false + false + + + +Scope for var. + + scope + false + false + + + +Name of the exported scoped variable for the +resource's content. The type of the scoped +variable is Reader. + + varReader + false + false + + + +Name of the context when accessing a relative +URL resource that belongs to a foreign +context. + + context + false + true + + + +Character encoding of the content at the input +resource. + + charEncoding + false + true + + + + + + The basic iteration tag, accepting many different + collection types and supporting subsetting and other + functionality + + forEach + org.apache.taglibs.standard.tag.rt.core.ForEachTag + org.apache.taglibs.standard.tei.ForEachTEI + JSP + + +Collection of items to iterate over. + + items + false + true + java.lang.Object + + java.lang.Object + + + + +If items specified: +Iteration begins at the item located at the +specified index. First item of the collection has +index 0. +If items not specified: +Iteration begins with index set at the value +specified. + + begin + false + true + int + + + +If items specified: +Iteration ends at the item located at the +specified index (inclusive). +If items not specified: +Iteration ends when index reaches the value +specified. + + end + false + true + int + + + +Iteration will only process every step items of +the collection, starting with the first one. + + step + false + true + int + + + +Name of the exported scoped variable for the +current item of the iteration. This scoped +variable has nested visibility. Its type depends +on the object of the underlying collection. + + var + false + false + + + +Name of the exported scoped variable for the +status of the iteration. Object exported is of type +javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested +visibility. + + varStatus + false + false + + + + + + Iterates over tokens, separated by the supplied delimeters + + forTokens + org.apache.taglibs.standard.tag.rt.core.ForTokensTag + JSP + + +String of tokens to iterate over. + + items + true + true + java.lang.String + + java.lang.String + + + + +The set of delimiters (the characters that +separate the tokens in the string). + + delims + true + true + java.lang.String + + + +Iteration begins at the token located at the +specified index. First token has index 0. + + begin + false + true + int + + + +Iteration ends at the token located at the +specified index (inclusive). + + end + false + true + int + + + +Iteration will only process every step tokens +of the string, starting with the first one. + + step + false + true + int + + + +Name of the exported scoped variable for the +current item of the iteration. This scoped +variable has nested visibility. + + var + false + false + + + +Name of the exported scoped variable for the +status of the iteration. Object exported is of +type +javax.servlet.jsp.jstl.core.LoopTag +Status. This scoped variable has nested +visibility. + + varStatus + false + false + + + + + + Like <%= ... >, but for expressions. + + out + org.apache.taglibs.standard.tag.rt.core.OutTag + JSP + + +Expression to be evaluated. + + value + true + true + + + +Default value if the resulting value is null. + + default + false + true + + + +Determines whether characters <,>,&,'," in the +resulting string should be converted to their +corresponding character entity codes. Default value is +true. + + escapeXml + false + true + + + + + + + Subtag of <choose> that follows <when> tags + and runs only if all of the prior conditions evaluated to + 'false' + + otherwise + org.apache.taglibs.standard.tag.common.core.OtherwiseTag + JSP + + + + + Adds a parameter to a containing 'import' tag's URL. + + param + org.apache.taglibs.standard.tag.rt.core.ParamTag + JSP + + +Name of the query string parameter. + + name + true + true + + + +Value of the parameter. + + value + false + true + + + + + + Redirects to a new URL. + + redirect + org.apache.taglibs.standard.tag.rt.core.RedirectTag + JSP + + +The URL of the resource to redirect to. + + url + false + true + + + +Name of the context when redirecting to a relative URL +resource that belongs to a foreign context. + + context + false + true + + + + + + Removes a scoped variable (from a particular scope, if specified). + + remove + org.apache.taglibs.standard.tag.common.core.RemoveTag + empty + + +Name of the scoped variable to be removed. + + var + true + false + + + +Scope for var. + + scope + false + false + + + + + + Sets the result of an expression evaluation in a 'scope' + + set + org.apache.taglibs.standard.tag.rt.core.SetTag + JSP + + +Name of the exported scoped variable to hold the value +specified in the action. The type of the scoped variable is +whatever type the value expression evaluates to. + + var + false + false + + + +Expression to be evaluated. + + value + false + true + + java.lang.Object + + + + +Target object whose property will be set. Must evaluate to +a JavaBeans object with setter property property, or to a +java.util.Map object. + + target + false + true + + + +Name of the property to be set in the target object. + + property + false + true + + + +Scope for var. + + scope + false + false + + + + + + Creates a URL with optional query parameters. + + url + org.apache.taglibs.standard.tag.rt.core.UrlTag + JSP + + +Name of the exported scoped variable for the +processed url. The type of the scoped variable is +String. + + var + false + false + + + +Scope for var. + + scope + false + false + + + +URL to be processed. + + value + false + true + + + +Name of the context when specifying a relative URL +resource that belongs to a foreign context. + + context + false + true + + + + + + Subtag of <choose> that includes its body if its + condition evalutes to 'true' + + when + org.apache.taglibs.standard.tag.rt.core.WhenTag + JSP + + +The test condition that determines whether or not the +body content should be processed. + + test + true + true + boolean + + + + diff --git a/examples/jsp/src/main/webapp/WEB-INF/included.jsp b/examples/jsp/src/main/webapp/WEB-INF/included.jsp new file mode 100644 index 00000000..1931d893 --- /dev/null +++ b/examples/jsp/src/main/webapp/WEB-INF/included.jsp @@ -0,0 +1,2 @@ +<%@page contentType="text/html" pageEncoding="UTF-8" session="false"%> +

Hello World, again...

diff --git a/examples/jsp/src/main/webapp/WEB-INF/views/simple-page.jsp b/examples/jsp/src/main/webapp/WEB-INF/views/simple-page.jsp new file mode 100644 index 00000000..194cac5b --- /dev/null +++ b/examples/jsp/src/main/webapp/WEB-INF/views/simple-page.jsp @@ -0,0 +1,15 @@ +<%@page contentType="text/html" pageEncoding="UTF-8" session="false" buffer="1kb" %> + + + + + + Simple Page + + + +

Hello World!

+

This is a really simple page...

+

This version of a really simple page was delivered via SPRING!

+ + diff --git a/examples/jsp/src/main/webapp/WEB-INF/web.xml b/examples/jsp/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..64cdaf70 --- /dev/null +++ b/examples/jsp/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,94 @@ + + + + + + + contextConfigLocation + classpath:/config.xml + + + + + + + org.springframework.web.context.ContextLoaderListener + + + + + + + accelerator + de.halbekunst.juplo.cachecontrol.AcceleratorFilter + + + + logger + de.halbekunst.juplo.test.LoggingHttpServletResponseFilter + + + + + + + logger + *.jsp + + + + accelerator + *.html + + + accelerator + *.jsp + + + accelerator + *.css + + + accelerator + /test-servlet + + + accelerator + /spring/* + + + + + + + test-servlet + de.halbekunst.juplo.test.TestServlet + + + + dispatcher-servlet + org.springframework.web.servlet.DispatcherServlet + + contextConfigLocation + + + + 1 + + + + + + + test-servlet + /test-servlet + + + + dispatcher-servlet + /spring/* + + + diff --git a/examples/jsp/src/main/webapp/default.css b/examples/jsp/src/main/webapp/default.css new file mode 100644 index 00000000..e04bba27 --- /dev/null +++ b/examples/jsp/src/main/webapp/default.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/jsp/src/main/webapp/index.html b/examples/jsp/src/main/webapp/index.html new file mode 100644 index 00000000..cd95f2c5 --- /dev/null +++ b/examples/jsp/src/main/webapp/index.html @@ -0,0 +1,40 @@ + + + + + + Static Page + + + +

Static Page

+

This page is a static HTML-page

+

At the same time, it gives an overview over all tests...

+

JSP-Pages

+ +

Static Content

+ +

Dynamic Servlet-Answers

+ + + diff --git a/examples/jsp/src/main/webapp/page-with-forward.jsp b/examples/jsp/src/main/webapp/page-with-forward.jsp new file mode 100644 index 00000000..35e49058 --- /dev/null +++ b/examples/jsp/src/main/webapp/page-with-forward.jsp @@ -0,0 +1,14 @@ +<%@page contentType="text/html" pageEncoding="UTF-8" session="false" buffer="1kb" %> + + + + + + Page with forward + + +

Hello World!

+

This should not be seen, because the page is forwardes to /simple-page.jsp

+ + + diff --git a/examples/jsp/src/main/webapp/page-with-include.jsp b/examples/jsp/src/main/webapp/page-with-include.jsp new file mode 100644 index 00000000..ba581a46 --- /dev/null +++ b/examples/jsp/src/main/webapp/page-with-include.jsp @@ -0,0 +1,15 @@ +<%@page contentType="text/html" pageEncoding="UTF-8" session="false" buffer="1kb" %> +<%@taglib uri="/WEB-INF/c.tld" prefix="c"%> + + + + + + Page with include + + + +

Hello World!

+ ${i}: + + diff --git a/examples/jsp/src/main/webapp/simple-page.jsp b/examples/jsp/src/main/webapp/simple-page.jsp new file mode 100644 index 00000000..880d7611 --- /dev/null +++ b/examples/jsp/src/main/webapp/simple-page.jsp @@ -0,0 +1,14 @@ +<%@page contentType="text/html" pageEncoding="UTF-8" session="false" buffer="1kb" %> + + + + + + Simple Page + + + +

Hello World!

+

This is a really simple page...

+ + diff --git a/examples/jsp/src/test/java/de/halbekunst/cachecontrol/examples/jsp/JspTest.java b/examples/jsp/src/test/java/de/halbekunst/cachecontrol/examples/jsp/JspTest.java new file mode 100644 index 00000000..9861068b --- /dev/null +++ b/examples/jsp/src/test/java/de/halbekunst/cachecontrol/examples/jsp/JspTest.java @@ -0,0 +1,50 @@ +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 JspTest extends HttpTestCase { + + private static final Logger log = LoggerFactory.getLogger(JspTest.class); + + + public JspTest() { + super("src/main/webapp/WEB-INF/web.xml"); + } + + + @Test + public void testSimplePage() 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()); + } + + @Test + public void testPageWithInclude() throws Exception { + WebResponse response = executeRequest("http://localhost:8080/page-with-include.jsp"); + log.info("Title:\t\t{}", response.getTitle()); + log.debug("Text:\t\t{}", response.getText()); + } + + @Test + public void testPageWithForward() throws Exception { + WebResponse response = executeRequest("http://localhost:8080/page-with-forward.jsp"); + 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()); + } +} diff --git a/examples/jsp/tomcat.sh b/examples/jsp/tomcat.sh new file mode 100755 index 00000000..4378a128 --- /dev/null +++ b/examples/jsp/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 diff --git a/examples/pom.xml b/examples/pom.xml new file mode 100644 index 00000000..28a64a6b --- /dev/null +++ b/examples/pom.xml @@ -0,0 +1,137 @@ + + + + 4.0.0 + + + de.halbekunst + juplo + 2.0-SNAPSHOT + + + juplo-examples + pom + Juplo - Examples + + + jsp + + + + + + + ${pom.parent.groupId} + juplo-cachecontrol + ${pom.parent.version} + runtime + + + + + javax.servlet + jstl + ${jstl.version} + runtime + + + + + org.springframework + spring-webmvc + ${springframework.version} + runtime + + + org.springframework + spring-context + ${springframework.version} + runtime + + + + commons-logging + commons-logging + + + + + org.springframework + spring-aspects + ${springframework.version} + runtime + + + org.aspectj + aspectjrt + ${aspectj.version} + runtime + + + + + org.slf4j + ${slf4j.binding} + ${slf4j.version} + runtime + + + + + + ${pom.parent.groupId} + juplo-test + ${pom.parent.version} + + + org.apache.tomcat + jasper + ${jasper.version} + test + + + + + + + + org.mortbay.jetty + jetty-maven-plugin + 8.0.1.v20110908 + + + + 0.0.0.0 + 8080 + 2 + + + 0 + + + ${project.basedir}/src/main/webapp/WEB-INF + + **/*.jsp + + + **/*.properties + **/*.xml + + + + + + + org.codehaus.mojo + tomcat-maven-plugin + 1.1 + + / + UTF-8 + + + + + + diff --git a/pom.xml b/pom.xml index 624e53dc..97cb6a2e 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ test cachecontrol - cachecontrol-example-jsp + examples