📄 installation.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 (1.1)</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="Craig R. McClanahan" name="author" />
<meta content="Mike Schachter" name="author" />
<meta content="Ted Husted" name="author" />
<meta content="Martin Cooper" name="author" />
<meta content="Chris Assenza" name="author" />
<meta content="dIon Gillard" name="author" />
<meta content="Eric Wu" name="author" />
<meta content="John Rousseau" name="author" />
<meta content="John Ueltzhoeffer" name="author" />
<meta content="Mark Budai" name="author" />
<meta content="Paul Runyan" name="author" />
<meta content="Robert Hayden" name="author" />
<meta content="Stanley Santiago" name="author" />
<meta content="Wong Kok Kai" name="author" />
<meta content="Rob Leland" name="author" />
<meta content="John Berry" 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>Craig R. McClanahan</li>
<li>Mike Schachter</li>
<li>Ted Husted</li>
<li>Martin Cooper</li>
<li>Chris Assenza</li>
<li>dIon Gillard</li>
<li>Eric Wu</li>
<li>John Rousseau</li>
<li>John Ueltzhoeffer</li>
<li>Mark Budai</li>
<li>Paul Runyan</li>
<li>Robert Hayden</li>
<li>Stanley Santiago</li>
<li>Wong Kok Kai</li>
<li>Rob Leland</li>
<li>John Berry</li>
</ul>
</div>
</div>
<!--end menu-->
<div id="main">
<h1 id="installation">6.2 Installation</h1>
<h2 id="Prerequisites">Prerequisite Software</h2>
<div class="indent">
<p>The Struts binary distribution needs three other software packages installed to
operate. You may already have these installed on your system. To build Struts from
source you may need to acquire and install several others. The complete list is as
follows:</p>
<ul>
<li>
<strong>Java Development Kit</strong> - You <strong>must</strong> download and install
a Java2 (version 1.2 or later) Java Development Kit implementation for
your operating system platform.
A good starting point for locating Java Development Kit distributions is
<a href="http://java.sun.com/j2se">http://java.sun.com/j2se</a>.
To build Struts, Java 1.4.2 (the latest production JDK) is suggested. </li>
<li>
<strong>Servlet Container</strong> - You <strong>must</strong> download and install a
servlet container that is compatible with the Servlet API Specification,
version 2.2 or later, and the JavaServer Pages (JSP) Specification,
version 1.1 or later. One popular choice is to download Apache's
<a href="http://jakarta.apache.org/tomcat/">Tomcat</a>, but any compliant
container should work well with Struts.</li>
<li>
<strong>XML Parser</strong> - Struts <strong>requires</strong> the presence of an XML
parser that is compatible with the Java API for XML Parsing (JAXP)
specification, 1.1 or later. This is bundled with J2SE 1.4 and later.
For earlier versions of Java, the easiest way to obtain JAXP is
probably by downloading the Web Services Developers Kit
(1.1 or later!). See the <a href="http://java.sun.com/xml/jaxp/faq.html#jaxp-ri-latest">
Sun JAXP FAQ</a> for more information.)
In Struts-based web applications, you may replace the reference
implementation classes with any other JAXP compliant parser, such as
<a href="http://xml.apache.org/xerces-j">Xerces</a>. See detailed
instructions related to the parser in the instructions for
<a href="#Building">building</a> and <a href="#Installing">installing</a>
Struts, below.</li>
<li>
<strong>Ant Build System</strong> - If you are building Struts from the
source distribution, you must download and install version 1.5.4 (or later)
of the <a href="http://jakarta.apache.org/ant">Ant</a> build system.
<ul>
<li>Make sure that the "ant" and "ant.bat" scripts are executable, by
adding the $ANT_HOME/bin directory to your PATH environment
variable.</li>
<li>
Copy and review either the "build.properties.sample" or
"build.properties.sample.lib" file as "build.properties".
The latter is recommended if you are not active in Jakarta
Commons development.
</li>
<li>
<a href="http://maven.apache.org/">Maven</a> property files are also
provided, but the Maven build is still experimental. New developers
may find Maven easier to use, since it acquires the appropriate JARs
automatically.
</li>
</ul>
</li>
<li>
<strong>Servlet API Classes</strong> - In order to compile Struts itself,
or applications that use Struts, you will need a <code>servlet.jar</code>
file containing the Servlet and JSP API classes. Most servlet containers
include this JAR file. Otherwise, you can get the Servlet API classes
distribution from
<a href="http://jakarta.apache.org/builds/jakarta-servletapi">here</a>.
</li>
<li>
<strong>JDBC 2.0 Optional Package Classes</strong> - Struts supports
an optional implementation of <code>javax.sql.DataSource</code>, so it
requires the API classes to be compiled. They can be downloaded from
<a href="http://java.sun.com/products/jdbc/download.html">http://java.sun.com/products/jdbc/download.html</a>.</li>
<li>
<strong>Other Packages</strong> - Struts utilizes several
packages from other open source projects, especially the <a href="http://jakarta.apache.org/commons/">Jakarta
Commons Project</a>.
These are the packages which must be available if you wish to
build Struts from source:
<ul>
<li>
<a href="http://www.antlr.org/">ANTLR</a> (Version 2.7.2)</li>
<li>
<a href="http://jakarta.apache.org/commons/beanutils/">Jakarta Commons Beanutils</a> (Version 1.7.0)</li>
<li>
<a href="http://jakarta.apache.org/commons/digester/">Jakarta Commons Digester</a> (Version 1.6)</li>
<li>
<a href="http://jakarta.apache.org/commons/fileupload/">Jakarta Commons FileUpload</a> (Version 1.0)</li>
<li>
<a href="http://jakarta.apache.org/commons/logging/">Jakarta Commons Logging</a> (Version 1.0.4)</li>
<li>
<a href="http://jakarta.apache.org/commons/validator/">Jakarta Commons Validator</a> (Version 1.1.4) </li>
<li>
<a href="http://jakarta.apache.org/oro/">Jakarta ORO</a> (Version 2.0.7)</li>
</ul>
ANTLR is a <a href="http://antlr.org/license.html">public domain library</a>;
all other libraries are distributed under the
<a href="http://www.apache.org/licenses/">Apache Software License</a>.
For your convenience, the requisite JARs are provided as a single
download under the <code>lib</code> sub-directory with each release
distribution.
Please note that the minimum requirements may change between releases,
and some JARs may need to be updated to use the latest Nightly Build.
</li>
<li>
<strong>Xalan XSLT Processor</strong> - If you are building Struts from
the source distribution, you will need a version of Xalan to perform
XSLT transformations. If you are using the JAXP/1.1 XML parser, you
should use the version of <code>xalan.jar</code> shipped with it.
Otherwise, download and install version 1.2 of Xalan from
<a href="http://xml.apache.org/xalan">here</a>.
</li>
<li>
<strong>Unit tests</strong> - To verify your build against the JUnit and
Cactus unit tests, three other packages must be available:
<ul>
<li>
<a href="http://jakarta.apache.org/cactus">Jakarta Cactus</a> (Version 1.4.1)</li>
<li>
<a href="http://jakarta.apache.org/commons/lang/">Jakarta Commons Lang</a> (Version 2.0)</li>
<li>
<a href="http://www.junit.org">JUnit</a> (Version 3.8.1)</li>
</ul>
</li>
</ul>
</div>
<h2 id="Installing">Install A Struts Binary Distribution</h2>
<div class="indent">
<p>First, download a binary distribution of Struts by following the
instructions <a href="../acquiring.html">here</a>. Then, make sure
you have downloaded and installed the
<a href="#Prerequisites">prerequisite</a> software packages described
above.</p>
<p>Unpack the Struts binary distribution into a convenient directory.
(If you <a href="#Building">build Struts from the source distribution</a>,
the result of the build will already be an unpacked binary distribution
for you). The distribution consists of the following contents:</p>
<ul>
<li>
<strong>lib/*.jar</strong> - The struts.jar contains the Java classes
distributed by the Struts project. The other JAR files contain packages
from other projects that are imported by Struts. When you launch
a Struts-based application, these JARs need to be available to your
application, usually by copying them to the application's
<code>WEB-INF/lib</code> directory. <br />
<em>WARNING</em> - If you are going to be hosting multiple Struts
based applications on the same servlet container, you will be tempted
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -