Merge remote-tracking branch 'origin/master' into servlet-3.1-api

This commit is contained in:
Jan Bartel 2013-05-06 17:00:47 +10:00
commit a5c143063f
25 changed files with 387 additions and 285 deletions

View File

@ -103,6 +103,36 @@
<outputDirectory>${assembly-directory}/webapps.demo</outputDirectory>
<destFileName>test.war</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.eclipse.jetty.tests</groupId>
<artifactId>test-jaas-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
<overWrite>true</overWrite>
<includes>**</includes>
<outputDirectory>${assembly-directory}/webapps.demo</outputDirectory>
<destFileName>test-jaas.war</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.eclipse.jetty.tests</groupId>
<artifactId>test-jndi-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
<overWrite>true</overWrite>
<includes>**</includes>
<outputDirectory>${assembly-directory}/webapps.demo</outputDirectory>
<destFileName>test-jndi.war</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.eclipse.jetty.tests</groupId>
<artifactId>test-spec-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
<overWrite>true</overWrite>
<includes>**</includes>
<outputDirectory>${assembly-directory}/webapps.demo</outputDirectory>
<destFileName>test-spec.war</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.eclipse.jetty</groupId>
<artifactId>test-proxy-webapp</artifactId>
@ -173,6 +203,7 @@
</artifactItems>
</configuration>
</execution>
<execution>
<id>unpack-setuid-config</id>
<phase>process-resources</phase>
@ -193,6 +224,70 @@
</artifactItems>
</configuration>
</execution>
<execution>
<id>unpack-test-jaas-config</id>
<phase>process-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.jetty.tests</groupId>
<artifactId>test-jaas-webapp</artifactId>
<version>${project.version}</version>
<classifier>config</classifier>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${assembly-directory}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<execution>
<id>unpack-test-jndi-config</id>
<phase>process-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.jetty.tests</groupId>
<artifactId>test-jndi-webapp</artifactId>
<version>${project.version}</version>
<classifier>config</classifier>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${assembly-directory}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<execution>
<id>unpack-test-spec-config</id>
<phase>process-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.jetty.tests</groupId>
<artifactId>test-spec-webapp</artifactId>
<version>${project.version}</version>
<classifier>config</classifier>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${assembly-directory}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<execution>
<id>copy-lib-deps</id>
<phase>generate-resources</phase>

View File

@ -0,0 +1,124 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<!-- =============================================================== -->
<!-- Configure the demos -->
<!-- =============================================================== -->
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<!-- ============================================================= -->
<!-- Add webapps.demo to deployment manager scans -->
<!-- ============================================================= -->
<Ref refid="DeploymentManager">
<Call id="webappprovider" name="addAppProvider">
<Arg>
<New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
<Set name="monitoredDirName"><Property name="jetty.home" default="." />/webapps.demo</Set>
<Set name="defaultsDescriptor"><Property name="jetty.home" default="." />/etc/webdefault.xml</Set>
<Set name="scanInterval">1</Set>
<Set name="extractWars">true</Set>
<Set name="configurationManager">
<New class="org.eclipse.jetty.deploy.PropertiesConfigurationManager"/>
</Set>
</New>
</Arg>
</Call>
</Ref>
<!-- ============================================================= -->
<!-- Add rewrite rules -->
<!-- ============================================================= -->
<Ref refid="Rewrite">
<!-- Add rule to protect against IE ssl bug -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.MsieSslRule"/>
</Arg>
</Call>
<!-- protect favicon handling -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.HeaderPatternRule">
<Set name="pattern">/favicon.ico</Set>
<Set name="name">Cache-Control</Set>
<Set name="value">Max-Age=3600,public</Set>
<Set name="terminating">true</Set>
</New>
</Arg>
</Call>
<!-- redirect from the welcome page to a specific page -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
<Set name="pattern">/test/rewrite/</Set>
<Set name="replacement">/test/rewrite/info.html</Set>
</New>
</Arg>
</Call>
<!-- replace the entire request URI -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
<Set name="pattern">/test/some/old/context</Set>
<Set name="replacement">/test/rewritten/newcontext</Set>
</New>
</Arg>
</Call>
<!-- replace the beginning of the request URI -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
<Set name="pattern">/test/rewrite/for/*</Set>
<Set name="replacement">/test/rewritten/</Set>
</New>
</Arg>
</Call>
<!-- reverse the order of the path sections -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.RewriteRegexRule">
<Set name="regex">(.*?)/reverse/([^/]*)/(.*)</Set>
<Set name="replacement">$1/reverse/$3/$2</Set>
</New>
</Arg>
</Call>
<!-- add a cookie to each path visited -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.CookiePatternRule">
<Set name="pattern">/*</Set>
<Set name="name">visited</Set>
<Set name="value">yes</Set>
</New>
</Arg>
</Call>
<!-- actual redirect, instead of internal rewrite -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.RedirectPatternRule">
<Set name="pattern">/test/redirect/*</Set>
<Set name="location">/test/redirected</Set>
</New>
</Arg>
</Call>
<!-- add a response rule -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.ResponsePatternRule">
<Set name="pattern">/400Error</Set>
<Set name="code">400</Set>
<Set name="reason">ResponsePatternRule Demo</Set>
</New>
</Arg>
</Call>
</Ref>
</Configure>

View File

@ -0,0 +1,53 @@
# ===========================================================
# Enable the demonstration web applications
#
# To disable the demos, either delete this file, move it out of
# the start.d directory or rename it to not end with ".ini"
# ===========================================================
# ===========================================================
# Enable rewrite handler
# -----------------------------------------------------------
OPTIONS=rewrite
etc/jetty-rewrite.xml
# ===========================================================
# Add a deploy app provider to scan the webapps.demo directory
# -----------------------------------------------------------
etc/jetty-demo.xml
# ===========================================================
# Enable the Jetty HTTP client APIs for use by demo webapps
# -----------------------------------------------------------
OPTIONS=client
# ===========================================================
# Enable the test-realm login service for use by authentication
# demonstrations
# -----------------------------------------------------------
etc/test-realm.xml
# ===========================================================
# Enable JAAS test webapp
# -----------------------------------------------------------
OPTIONS=jaas
jaas.login.conf=webapps.demo/test-jaas.d/login.conf
etc/jetty-jaas.xml
# ===========================================================
# Enable JNDI test webapp
# -----------------------------------------------------------
OPTIONS=jndi,jndi.demo
# ===========================================================
# Enable additional webapp environment configurators
# -----------------------------------------------------------
OPTIONS=plus
etc/jetty-plus.xml
# ===========================================================
# Enable servlet 3.1 annotations
# -----------------------------------------------------------
OPTIONS=annotations
etc/jetty-annotations.xml

View File

@ -96,7 +96,18 @@ etc/jetty-jmx.xml
OPTIONS=jsp
#===========================================================
# Server logging.
# Request logger
# Will add a handler to log all HTTP requests to a standard
# request log format file.
#-----------------------------------------------------------
# requestlog.retain=90
# requestlog.append=true
# requestlog.extended=true
# etc/jetty-requestlog.xml
#===========================================================
# stderr/stdout logging.
# The following configuration will redirect stderr and stdout
# to file which is rolled over daily.
#-----------------------------------------------------------
@ -176,26 +187,30 @@ etc/jetty-http.xml
etc/jetty-deploy.xml
#===========================================================
# Annotations JNDI JAAS processing
#-----------------------------------------------------------
# ===========================================================
# Enable JAAS
# -----------------------------------------------------------
# OPTIONS=jaas
# jaas.login.conf=etc/login.conf
# etc/jetty-jaas.xml
# ===========================================================
# Enable JNDI
# -----------------------------------------------------------
# OPTIONS=jndi
# ===========================================================
# Enable additional webapp environment configurators
# -----------------------------------------------------------
# OPTIONS=plus
# etc/jetty-plus.xml
# ===========================================================
# Enable servlet 3.1 annotations
# -----------------------------------------------------------
# OPTIONS=annotations
# etc/jetty-annotations.xml
#===========================================================
# Request logger
# Will add a handler to log all HTTP requests to a standard
# request log format file.
#-----------------------------------------------------------
# requestlog.retain=90
# requestlog.append=true
# requestlog.extended=true
# etc/jetty-requestlog.xml
#===========================================================
# Other server features
#-----------------------------------------------------------

View File

@ -34,8 +34,9 @@
<ul>
<li><a href="/test/">Test Jetty Webapp</a></li>
<li><a href="/async-rest/">Async Rest</a></li>
<li><a href="/proxy/apidocs/">Transparent Proxy to Javadoc</a></li>
<li><a href="/proxy/xref/">Transparent Proxy to Xref</a></li>
<li><a href="/test-jaas/">JAAS Test</a></li>
<li><a href="/test-jndi/">JNDI Test</a></li>
<li><a href="/test-spec/">Servlet 3.1 Test</a></li>
<li><a href="/oldContextPath/">Redirected Context</a></li>
</ul>
</td>
@ -44,6 +45,8 @@
<ul>
<li><a href="http://www.eclipse.org/jetty/">Jetty @ Eclipse Home</a></li>
<li><a href="http://wiki.eclipse.org/Jetty">Jetty @ Eclipse Doco</a></li>
<li><a href="/proxy/apidocs/">Javadoc</a> (via transparent proxy)</li>
<li><a href="/proxy/xref/">Xref</a> (via transparent proxy)</li>
<li><a
href="http://docs.codehaus.org/display/JETTY/Jetty+Powered">Jetty Powered</a></li>
</ul>

View File

@ -11,7 +11,7 @@
<!-- ======================================================== -->
<Call class="java.lang.System" name="setProperty">
<Arg>java.security.auth.login.config</Arg>
<Arg><SystemProperty name="jetty.home" default="." />/etc/login.conf</Arg>
<Arg><Property name="jetty.home" default="." />/<Property name="jaas.login.conf" default="etc/login.conf"/></Arg>
</Call>
</Configure>

View File

@ -16,101 +16,9 @@
<Set name="handler">
<New id="Rewrite" class="org.eclipse.jetty.rewrite.handler.RewriteHandler">
<Set name="handler"><Ref refid="oldhandler"/></Set>
<Set name="rewriteRequestURI">true</Set>
<Set name="rewritePathInfo">false</Set>
<Set name="originalPathAttribute">requestedPath</Set>
<!-- Add rule to protect against IE ssl bug -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.MsieSslRule"/>
</Arg>
</Call>
<!-- protect favicon handling -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.HeaderPatternRule">
<Set name="pattern">/favicon.ico</Set>
<Set name="name">Cache-Control</Set>
<Set name="value">Max-Age=3600,public</Set>
<Set name="terminating">true</Set>
</New>
</Arg>
</Call>
<!-- redirect from the welcome page to a specific page -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
<Set name="pattern">/test/rewrite/</Set>
<Set name="replacement">/test/rewrite/info.html</Set>
</New>
</Arg>
</Call>
<!-- replace the entire request URI -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
<Set name="pattern">/test/some/old/context</Set>
<Set name="replacement">/test/rewritten/newcontext</Set>
</New>
</Arg>
</Call>
<!-- replace the beginning of the request URI -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
<Set name="pattern">/test/rewrite/for/*</Set>
<Set name="replacement">/test/rewritten/</Set>
</New>
</Arg>
</Call>
<!-- reverse the order of the path sections -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.RewriteRegexRule">
<Set name="regex">(.*?)/reverse/([^/]*)/(.*)</Set>
<Set name="replacement">$1/reverse/$3/$2</Set>
</New>
</Arg>
</Call>
<!-- add a cookie to each path visited -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.CookiePatternRule">
<Set name="pattern">/*</Set>
<Set name="name">visited</Set>
<Set name="value">yes</Set>
</New>
</Arg>
</Call>
<!-- actual redirect, instead of internal rewrite -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.RedirectPatternRule">
<Set name="pattern">/test/redirect/*</Set>
<Set name="location">/test/redirected</Set>
</New>
</Arg>
</Call>
<!-- add a response rule -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.ResponsePatternRule">
<Set name="pattern">/400Error</Set>
<Set name="code">400</Set>
<Set name="reason">ResponsePatternRule Demo</Set>
</New>
</Arg>
</Call>
<Set name="rewriteRequestURI"><Property name="rewrite.rewriteRequestURI" default="true"/></Set>
<Set name="rewritePathInfo"><Property name="rewrite.rewritePathInfo" default="false"/></Set>
<Set name="originalPathAttribute"><Property name="rewrite.originalPathAttribute" default="requestedPath"/></Set>
</New>
</Set>

View File

@ -34,7 +34,7 @@
<!-- Mandatory. This system property tells JAAS where to find the login module configuration file -->
<systemProperty>
<name>java.security.auth.login.config</name>
<value>${basedir}/src/main/config/etc/login.conf</value>
<value>${basedir}/src/main/config/webapps.demo/test-jaas.d/login.conf</value>
</systemProperty>
</systemProperties>
<webAppConfig>

View File

@ -11,7 +11,7 @@
<outputDirectory></outputDirectory>
<includes>
<include>webapps/test-jaas.xml</include>
<include>etc/**</include>
<include>**</include>
</includes>
</fileSet>
</fileSets>

View File

@ -1,5 +1,5 @@
xyz {
org.eclipse.jetty.jaas.spi.PropertyFileLoginModule required
debug="true"
file="${jetty.home}/etc/login.properties";
file="${jetty.home}/webapps.demo/test-jaas.d/login.properties";
};

View File

@ -7,7 +7,7 @@
<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/test-jaas</Set>
<Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/test-jaas.war</Set>
<Set name="war"><Property name="jetty.webapps" default="."/>/test-jaas.war</Set>
<Set name="extractWAR">true</Set>
<Set name="securityHandler">

View File

@ -5,8 +5,8 @@
</HEAD>
<BODY>
<H1>Congratulations, you are AUTHENTICATED and web AUTHORIZED</H1>
Well done. In order to see this page, you must have been JAAS authentictated using the
<H1>SUCCESS! You are AUTHENTICATED and AUTHORIZED</H1>
In order to see this page, you must have been JAAS authentictated using the
configured Login Module. You have also been AUTHORIZED according to this webapp's role-based web security constraints.
<P>
To logout click:

View File

@ -22,26 +22,17 @@
<H1>JAAS Authentication and Authorization Demo </H1>
<h2>Preparation</h2>
<ol>
<li>You will need to edit your $JETTY_HOME/start.ini file and add the following lines:
<p>To enable JAAS, edit your start.ini or start.d/*.ini files and add the following lines:
<pre>
OPTIONS=jaas
jaas.login.conf=etc/login.conf
etc/jetty-jaas.xml
</pre>
</li>
<li>Unjar the test-jaas-webapp-&lt;version&gt;-config.jar inside $JETTY_HOME. The following files will be added:
<pre>
etc/login.conf
etc/login.properties
contexts/test-jaas.xml
</pre>
</li>
</ol>
<p>Now start jetty as usual.</p>
</p>
<p>For the jetty distribution demos, jaas is already enabled in the start.d/900-demo.ini file and sets the jaas.login.conf property to webapps.demo/test-jaas.d/login.conf for use with the webapps.demo/test-jaas.war web application. </p>
<p>The full source of this demonstration is available <a
href="http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/tests/test-webapps/test-jaas-webapp">here</a>.</p>
<h2>Using the Demo</h2>
<P>

View File

@ -1,21 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<!-- =============================================================== -->
<!-- Create the demo deployment provider -->
<!-- =============================================================== -->
<Configure id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">
<Call id="webappprovider" name="addAppProvider">
<Arg>
<New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
<Set name="monitoredDirName"><Property name="jetty.home" default="." />/webapps.demo</Set>
<Set name="defaultsDescriptor"><Property name="jetty.home" default="." />/etc/webdefault.xml</Set>
<Set name="scanInterval">1</Set>
<Set name="extractWars">true</Set>
<Set name="configurationManager">
<New class="org.eclipse.jetty.deploy.PropertiesConfigurationManager"/>
</Set>
</New>
</Arg>
</Call>
</Configure>

View File

@ -1,26 +0,0 @@
# ===========================================================
# Enable the demonstration web applications
#
# To disable the demos, either delete this file, move it out of
# the start.d directory or rename it to not end with ".ini"
# ===========================================================
# ===========================================================
# Add a deploy app provider to scan the webapps.demo directory
# -----------------------------------------------------------
etc/jetty-demo.xml
# ===========================================================
# Enable the Jetty HTTP client APIs for use by demo webapps
# -----------------------------------------------------------
OPTIONS=client
# ===========================================================
# Enable the test-realm login service for use by authentication
# demonstrations
# -----------------------------------------------------------
etc/test-realm.xml

View File

@ -13,49 +13,37 @@
<A HREF="http://jetty.eclipse.org"><IMG SRC="jetty_banner.gif"></A>
<h1>Welcome to Jetty 9</h1>
<p>
This is the Test webapp for the Jetty 9 HTTP Server and Servlet Container.
For more information about Jetty, please visit our
<a href="http://www.eclipse.org/jetty">website</a>
or <a href="http://www.eclipse.org/jetty/documentation/current/">documentation</a> hub.<br/>
Commercial support for Jetty is available via <a href="http://www.webtide.com">Webtide</a> and <a href="http://www.intalio.com">Intalio</a>.
</p>
<p>
This is a test context that serves:
</p>
This is the Test webapp for the Jetty 9 HTTP Server and Servlet Container. It is
deployed in $JETTY_HOME/webapp.demo and configured by $JETTY_HOME/start.d/900-demo.ini
<ul>
<li>Servet: <a href="hello/">Hello World</a></li>
<li>Dump: <a href="dump/info">Request</a>, <a href="session/">Session</a>, <a href="cookie/">Cookie</a></li>
<li>JSP: <a href="jsp/">examples</a></li>
<li>Comet Chat: <a href="chat/">Long Polling</a>, <a href="ws">WebSocket</a></li>
<li><a href="auth.html">Authentication</a></li>
<li><a href="dispatch">Dispatcher Servlet</a></li>
<li><a href="rewrite/">Request Rewrite Servlet</a></li>
<li>static content:
<a href="d.txt">tiny</a>,
<a href="da.txt">small</a>,
<a href="dat.txt">medium</a>,
<a href="data.txt">large</a>,
<a href="data.txt.gz">large gziped</a></li>
<li><a href="hello/">Hello World Servlet</a></li>
<li>Dump: <a href="dump/info">Request</a>, <a href="session/">Session</a>, <a href="cookie/">Cookie</a></li>
<li><a href="dispatch">Dispatcher Servlet</a></li>
<li><a href="rewrite/">Request Rewrite Servlet</a></li>
<li><a href="jsp/">JSP examples</a></li>
<li>Comet Chat: <a href="chat/">Long Polling</a>, <a href="ws">WebSocket</a></li>
<li><a href="auth.html">Authentication</a></li>
</ul>
<p/>
<!--
<p>
Other demonstration contexts, some of which may need manual deployment
(check the README.txt file for details):
</p>
<ul>
<li>a <a href="chat/demo">AJAX Comet Chat with com.acme.ChatServlet demo</a></li>
<li>a <a href="/cometd/">AJAX Cometd Chat with cometd Bayeux</a></li>
<li> the <a href="/javadoc/">javadoc</a> </li>
<li> a demo of the <a href="/test-jndi">JNDI features</a></li>
<li> a demo of the <a href="/test-annotations">Annotation features</a></li>
<li> a demo of the <a href="/test-jaas">JAAS features</a></li>
Useful links are:<ul>
<li><a
href="http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/tests/test-webapps/test-jetty-webapp">Source
tree of this webapp</a></li>
<li><a href="http://www.eclipse.org/jetty">Jetty project home</a></li>
<li><a href="http://www.eclipse.org/jetty/documentation/current/">Documentation</a></li>
<li><a href="http://www.webtide.com">Commercial Support</a></li>
</ul>
<p/>
-->
This webapp is deployed in $JETTY_HOME/webapp/test and configured by $JETTY_HOME/contexts/test.xml
</p>
<p>
<a href="/">MAIN MENU</a>
</p>
</BODY>
</HTML>

View File

@ -18,16 +18,16 @@
</fileSet>
<fileSet>
<directory>target</directory>
<outputDirectory>webapps</outputDirectory>
<outputDirectory>webapps.demo</outputDirectory>
<includes>
<include>test-jndi.xml</include>
</includes>
</fileSet>
<fileSet>
<directory>target</directory>
<outputDirectory></outputDirectory>
<directory>target/lib/jndi</directory>
<outputDirectory>lib/jndi.demo</outputDirectory>
<includes>
<include>lib/jndi/**</include>
<include>*.jar</include>
</includes>
</fileSet>
</fileSets>

View File

@ -35,7 +35,7 @@
-->
<Set name="contextPath">/test-jndi</Set>
<Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/test-jndi.war</Set>
<Set name="war"><Property name="jetty.webapps" default="."/>/test-jndi.war</Set>
<Set name="extractWAR">true</Set>
<Set name="copyWebDir">false</Set>
<Set name="configurationDiscovered">true</Set>

View File

@ -7,14 +7,9 @@
<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">
<New id="tx" class="org.eclipse.jetty.plus.jndi.Transaction">
<Arg>
<New class="com.acme.MockUserTransaction"/>
</Arg>
</New>
<!-- only necessary for mvn jetty:run -->
<Arg>
<New class="com.acme.MockUserTransaction"/>
</Arg>
</New>

View File

@ -29,21 +29,15 @@ This example shows how to configure and lookup resources such as DataSources, a
<h2>Preparation</h2>
<p>
<ol>
<li>Ensure that you have downloaded and unpacked the test-jndi-webapp-&lt;version&gt;-config.jar, where &lt;version&gt; is replaced by the desired version number. The following files will be created:
<pre>
lib/jndi/test-mock-resources-&lt;version&gt;.jar (where &lt;version&gt; is replaced by the particular version number)
webapps/test-jndi.xml
</pre>
</li>
<li>Edit your $JETTY_HOME/start.ini file and uncomment the following lines:
<pre>
OPTIONS=plus
etc/jetty-plus.xml
</pre>
</li>
</ol>
To enable JNDI edit the start.ini or start.d/*.ini files to include "OPTIONS=jndi".
</p>
<p>
For the jetty distribution demos, jndi is already enabled in the start.d/900-demo.ini file and also enables the
jndi.demo option which includes some mock resources used by the test.
</p>
<p>The full source of this demonstration is available <a href="http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/tests/test-webapps/test-jndi-webapp">here</a>.</p>
<h2>Execution</h2>
<p>

View File

@ -17,17 +17,17 @@
</excludes>
</fileSet>
<fileSet>
<directory>target</directory>
<outputDirectory>webapps</outputDirectory>
<directory>target</directory>
<outputDirectory>webapps.demo</outputDirectory>
<includes>
<include>test-spec.xml</include>
</includes>
</fileSet>
<fileSet>
<directory>target</directory>
<outputDirectory></outputDirectory>
<directory>target/lib/jndi</directory>
<outputDirectory>lib/jndi.demo</outputDirectory>
<includes>
<include>lib/jndi/**</include>
<include>*.jar</include>
</includes>
</fileSet>
</fileSets>

View File

@ -9,10 +9,10 @@
<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">
<New id="tx" class="org.eclipse.jetty.plus.jndi.Transaction">
<Arg>
<New class="com.acme.MockUserTransaction"/>
</Arg>
</New>
<Arg>
<New class="com.acme.MockUserTransaction"/>
</Arg>
</New>
<!-- =============================================================== -->
@ -39,7 +39,7 @@
-->
<Set name="contextPath">/test-spec</Set>
<Set name="war"><SystemProperty name="jetty.home"/>/webapps/test-spec.war</Set>
<Set name="war"><Property name="jetty.webapps"/>/test-spec.war</Set>
<Set name="configurationDiscovered">true</Set>
<Get name="securityHandler">

View File

@ -8,13 +8,10 @@
<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">
<!-- Configure the tx mgr (only needed for mvn jetty:run -->
<New id="tx" class="org.eclipse.jetty.plus.jndi.Transaction">
<Arg>
<New class="com.acme.MockUserTransaction"/>
</Arg>
</New>
<Arg>
<New class="com.acme.MockUserTransaction"/>
</Arg>
</New>

View File

@ -21,47 +21,33 @@
<span style="color:red; font-variant:small-caps; font-weight:bold">Test Web Application Only - Do NOT Deploy in Production</span>
</center>
<P>
<h1>Advanced Servlet Specification Test WebApp</h1>
<h1>Servlet 3.1 Test WebApp</h1>
<p>
This example uses and tests newer aspects of the servlet specification such as annotations, web-fragments and servlet container initializers.
This example tests some aspects of the servlet 3.1 specification:<ul>
<li>servlet annotations
<li>web-fragments
<li>servlet container initializers.
<li>multi-part upload support.
</ul>
The source repository for this test is available <a href="http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/tests/test-webapps/test-servlet-spec">here</a>.
</p>
<h2>Preparation</h2>
<p>
<ol>
<li>Ensure that you have downloaded and unpacked the test-spec-webapp-&lt;version&gt;-config.jar, where <version> is replaced by the desired version number. The following files will be created:
<pre>
lib/jndi/test-mock-resources-&lt;version&gt;.jar (where &lt;version&gt; is replaced by the particular version number)
webapps/test-spec.xml
</pre>
</li>
<li>Edit your $JETTY_HOME/start.ini file and uncomment the following lines:
<pre>
OPTIONS=plus
etc/jetty-plus.xml
OPTIONS=annotations
etc/jetty-annotations.xml
</pre>
</li>
</ol>
</p>
<h2>The Tests</h2>
<h3>Test Servlet 2.5/3.0 Annotations, Fragments and Initializers</h3>
<form action="test" method="post">
<button type="submit">Test</button>
</form>
<h3>Test Servlet 3.0 Multipart Mime</h3>
Test of the annotation:
<pre>
@MultipartConfig(location="foo/bar", maxFileSize=10240, maxRequestSize=-1, fileSizeThreshold=2048)
</pre>
<form ENCTYPE="multipart/form-data" ACTION="multi" METHOD=POST>
File to upload: <INPUT NAME="userfile1" TYPE="file">
<input TYPE="submit" VALUE="Test Upload">
</form>
<center>
<hr/>
<a href="http://www.eclipse.org/jetty"><img style="border:0" src="images/small_powered_by.gif"/></a>