📄 installation-jetty.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>The Struts Framework Project - Installation - Jetty</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="Paul Runyan" name="author" />
<link href="../struts.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="heading">
<a href="http://apache.org/">
<img id="asf_logo_wide" alt="The Apache Project" src="../images/asf_logo_wide.gif" />
</a>
<a href="http://struts.apache.org/">
<img id="struts-logo" alt="Struts Framework" src="../images/struts.gif" />
</a>
</div>
<!--end heading-->
<div id="content">
<div id="menu">
<p>User Guide</p>
<ul>
<li>
<a href="index.html">Table of Contents</a>
</li>
<li>
<a href="preface.html">Preface</a>
</li>
<li>
<a href="introduction.html">Introduction</a>
</li>
<li>
<a href="building_model.html">Model Components</a>
</li>
<li>
<a href="building_view.html">View Components</a>
</li>
<li>
<a href="building_controller.html">Controller Components</a>
</li>
<li>
<a href="configuration.html">Configuration</a>
</li>
<li>
<a href="release-notes.html">Release Notes</a>
</li>
<li>
<a href="installation.html">Installation</a>
</li>
</ul>
<p>Developer Guides</p>
<ul>
<li>
<a href="dev_bean.html">Bean Tags</a>
</li>
<li>
<a href="dev_html.html">HTML Tags</a>
</li>
<li>
<a href="dev_logic.html">Logic Tags</a>
</li>
<li>
<a href="dev_nested.html">Nested Tags</a>
</li>
<li>
<a href="dev_tiles.html">Tiles Tags</a>
</li>
<li>
<a href="dev_util.html">Utilities</a>
</li>
<li>
<a href="dev_validator.html">Validator</a>
</li>
</ul>
<p>Quick Links</p>
<ul>
<li>
<a href="../index.html">Welcome</a>
</li>
<li>
<a href="index.html">User and Developer Guides *</a>
</li>
<li>
<a href="../faqs/index.html">FAQs and HowTos</a>
</li>
</ul>
<div class="authors">
<p>
<strong>Contributors</strong>
</p>
<ul>
<li>Paul Runyan</li>
</ul>
</div>
</div>
<!--end menu-->
<div id="main">
<h1 id="installation">5.2 Installation</h1>
<h2 id="Containers">Installing Struts with your servlet container</h2>
<div class="indent">
<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>
</div>
</div>
<!--end main-->
</div>
<!--end content-->
<div id="footer">
<img id="powered-logo" alt="Powered by Struts" src="../images/struts-power.gif" />
Copyright (c) 2000-2005, The Apache Software Foundation <span class="noprint">-
<a href="http://wiki.apache.org/struts/StrutsDocComments">Comments?</a>
</span>
</div>
<!--end footer-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -