| <?xml version="1.0"?> |
| |
| <document url="installation-ip.html"> |
| |
| <properties> |
| <title>The Struts Framework Project - Installation - Jetty</title> |
| </properties> |
| |
| <body> |
| <section name="5.2 Installation" href="installation"/> |
| <section name="Installing Struts with your servlet container" href="Containers"> |
| |
| <h4 id="jetty">Jetty Java HTTP Servlet Server</h4> |
| |
| <p> |
| Jetty is a small, pure-Java, open source HTTP server that supports the |
| 2.3 Servlet spec and JSP 1.2. Jetty can be downloaded from |
| <a href="http://www.mortbay.com/jetty">http://www.mortbay.com/jetty</a>. |
| </p> |
| |
| <p> |
| Struts WAR files run nearly straight out of the box when placed |
| underneath Jetty's webapps directory. The one additional step needed |
| is to add an entry for each WAR file to the Jetty server configuration |
| file in order to map the appropriate request paths to the added Struts |
| web applications (using "<Call name="addWebApplication">..."). |
| </p> |
| |
| <p> |
| So for example, if you have copied the WAR files that come with the |
| Struts binary distribution into a subdirectory of the |
| "%JETTY_HOME%/webapps" called "%JETTY_HOME%/webapps/struts" so that |
| you have: |
| </p> |
| |
| <pre> |
| - %JETTY_HOME%/webapps/struts/struts-documentation.war |
| - %JETTY_HOME%/webapps/struts/struts-example.war |
| - %JETTY_HOME%/webapps/struts/struts-exercise-taglib.war |
| - %JETTY_HOME%/webapps/struts/struts-upload.war |
| - %JETTY_HOME%/webapps/struts/struts-blank.war |
| </pre> |
| |
| <p> |
| And you want to run Jetty using the demo.xml configuration file that |
| comes with Jetty, just add the following block to demo.xml, anywhere |
| after the Listeners are declared. |
| </p> |
| |
| <pre> |
| <!-- Jetty config for Struts BEGIN --> |
| |
| <Call name="addWebApplication"> |
| <Arg>/struts/struts-documentation/*</Arg> |
| <Arg><SystemProperty name="jetty.home" |
| default="."/>/webapps/struts/struts-documentation.war</Arg> |
| <Arg><SystemProperty name="jetty.home" |
| default="."/>/etc/webdefault.xml</Arg> |
| <Arg type="boolean">false</Arg> <!-- if true, |
| expand war in temp dir --> |
| </Call> |
| |
| <Call name="addWebApplication"> |
| <Arg>/struts/struts-example/*</Arg> |
| <Arg><SystemProperty name="jetty.home" |
| default="."/>/webapps/struts/struts-example.war</Arg> |
| <Arg><SystemProperty name="jetty.home" |
| default="."/>/etc/webdefault.xml</Arg> |
| <Arg type="boolean">true</Arg> <!-- if true, |
| expand war in temp dir --> |
| </Call> |
| |
| <Call name="addWebApplication"> |
| <Arg>/struts/struts-exercise-taglib/*</Arg> |
| <Arg><SystemProperty name="jetty.home" |
| default="."/>/webapps/struts/struts-exercise-taglib.war</Arg> |
| <Arg><SystemProperty name="jetty.home" |
| default="."/>/etc/webdefault.xml</Arg> |
| <Arg type="boolean">false</Arg> <!-- if true, |
| expand war in temp dir --> |
| </Call> |
| |
| <Call name="addWebApplication"> |
| <Arg>/struts/struts-upload/*</Arg> |
| <Arg><SystemProperty name="jetty.home" |
| default="."/>/webapps/struts/struts-upload.war</Arg> |
| <Arg><SystemProperty name="jetty.home" |
| default="."/>/etc/webdefault.xml</Arg> |
| <Arg type="boolean">true</Arg> <!-- if true, |
| expand war in temp dir --> |
| </Call> |
| |
| <Call name="addWebApplication"> |
| <Arg>/struts/struts-blank/*</Arg> |
| <Arg><SystemProperty name="jetty.home" |
| default="."/>/webapps/struts/struts-blank.war</Arg> |
| <Arg><SystemProperty name="jetty.home" |
| default="."/>/etc/webdefault.xml</Arg> |
| <Arg type="boolean">true</Arg> <!-- if true, |
| expand war in temp dir --> |
| </Call> |
| |
| <!-- Jetty config for Struts END --> |
| </pre> |
| |
| <hr/> |
| <p>Back to <a href="installation.html#Containers">Installation</a></p> |
| |
| </section> |
| |
| </body> |
| </document> |