$Id: README,v 1.16 2002/03/21 02:57:24 craigmcc Exp $
Struts
======
はじめに
--------
このサブプロジェクトには、"Struts"ソースコード、アプリケーション・サポートパッケージ、以下の主要なコンポーネントが含まれています:
- Controller servlet with アクション・マッピング・技術, implementing the Model-
View-Controller (MVC) デザインパターン for web applications commonly called
"Model 2", with a servlet as the "front component".
- Comprehensive custom tag library for building internationalized JSP pages
that have HTML forms which interact with JavaBeans that are managed
automatically by the controller servlet.
- Useful utility classes that can process XML input, as well as use Java
reflection to populate JavaBean properties by matching names in the same
way that the standard JSP tag
works.
Strutsのインストールと利用
---------------------------
次の手順で、バイナリ配布版のStrutsをあなたのwebアプリケーションで使えるようになります。もし Struts アプリケーション・フレームワークを実行するなら(exampleアプリケーションの実行を含む)全ての手順が必要です。 もし、MVCフレームワークではなく Struts カスタムTagライブラリだけが必要なら、(*)マークのステップだけが必要です。
- (*) あなたの利用しているOS用のJava 2 SDK(Java開発キット)をダウンロードして
インストールします。
JDKのインストールディレクトリを指すようにJAVA_HOME環境変数に設定し、
"$JAVA_HOME/bin"にPATHを設定します。
- Java API for XML Parsing (JAXP)の1.1仕様と互換性のあるXMLパーサをダウンロード
してインストールします。 有用な XMLパーサーは、に
ある JAXP リファレンス実装, バージョン 1.1以降です。その他にStrutsの動作が報
告されているJAXP互換パーサーには、Xerces, version 1.3.1
があります。 Be sure to add the "jaxp.jar" and
"crimson.jar" (or whatever JAR file comes with your parser) files to
your CLASSPATH environment variable.
- JDBC 2.0 オプショナルパッケージ・バイナリ (以前は標準拡張パッケージといわれ
ていました) をジャバソフトのWebサイト から
ダウンロードして、 "jdbc2_0-stdext.jar" ファイルを classpath またはシステム
拡張ディレクトリにインストールします。
- Download and install Xalan-J, from (or
use the version that came with your JAXP/1.1 download), and install
xalan.jar in the "lib" ディレクトリ of your Ant installation.
- (*) Servlet API 仕様, v2.2以降とJavaServer Pages (JSP) 仕様, v1.1以降をサ
ポートするServletコンテナをダウンロード、インストールします。
有用なサーブレットコンテナは、 にある Tomcat
v3.2以降です。
- (*) Struts バイナリ配布版を
からダウンロード
して解凍する。
- (*) Install the Struts documentation アプリケーション by deploying file
"lib/struts-documentation.war" into your servlet container, using the
standard techniques supported by that container. (Tomcatなら、ファイルを
$TOMCAT_HOME/webapps ディレクトリにコピーして Tomcatを再起動するだけです。)
- Install the Struts example application by deploying file
"lib/struts-example.war" into your servlet container, using the standard
techniques supported by that container. (Tomcatなら、このファイルを
$TOMCAT_HOME/webapps ディレクトリにコピーして Tomcatを再起動するだけです。).
- (*) Strutsの"lib/struts*.tld"ファイルをあなたのWebアプリケーションの
"WEB-INF" ディレクトリにコピーします。
- (*) Strutsの"lib"ディレクトリのJARファイル("struts.jar"と"commons-*.jar")を
あなたのWebアプリケーションの"WEB-INF/lib" ディレクトリにコピーします。
- (*) Modify your "WEB-INF/web.xml" file to include a element to
define the controller servlet, and a element to establish
which request URIs are mapped to this servlet. Normally, you will map
the controller servlet to a wildcard pattern ("/execute/*") or a filename
extension pattern ("*.do"). Use the "WEB-INF/web.xml" file from the
example application (see below) for an example of how this is done.
- (*) Modify the "WEB-INF/web.xml" file for your web application to include
a tag library declaration like this for each Struts tag library you will
be using:
/WEB-INF/struts-bean.tld
/WEB-INF/struts-bean.tld
- Create a file "WEB-INF/struts-config.xml" that defines the mappings for your
requests to specific action classes. Use the "struts-config.xml" file from
the example application (see below) as a guide.
- (*) In each JSP page that will use the Struts custom tags, add a line at
the top of the page like this (for each Struts tag library needed):
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="struts-bean" %>
(If you wish, you can use a prefix other that "struts-bean").
- When compiling your web application components, be sure that the
JAR files (copied above) are included on the CLASSPATH environment
variable used by your Java compiler.
Struts Documentation アプリケーション
-------------------------------------
Struts comes with a web application that contains all of the documentation
relevant to an application developer who wants to use it, including:
* Reference manual for the custom tag library
* User's Guide for applications based on the framework
* API documentation for the Struts classes
To view this documentation, deploy the file "webapps/struts-documentation.war"
into your servlet container, and use a web browser to access a URL like this:
http://localhost:8080/struts-documentation
For notes about installing Struts applications on various servlet containers,
please see the INSTALL document in the same directory as this README file.
Struts Example アプリケーション
-------------------------------
Struts comes with an example web application, which was installed into your
servlet container if you followed the steps above. This example is the
beginnings of a portal application that would allow users to register
themselves, and maintain a set of subscriptions they own to mail servers
elsewhere on the Internet. When completed, this application will provide
the ability to read mail from various mail servers, through the application.
In the absence of detailed documentation, this application can serve as a
guide to using the interesting features of Struts. You will find the source
code to the JSP pages associated with the example in directory "web/example",
and the source code to the Java classes in directory "src/example". The
source code to the Struts components themselves is in directory "src/share".
To run the example application, deploy the file "webapps/struts-example.war"
into your servlet container, and use a web browser to access a URL like this:
http://localhost:8080/struts-example
You can register yourself as a new user, or log on with username "user" and
password "pass".
For notes about installing Struts applications on various servlet containers,
please see the INSTALL document in the same directory as this README file.
Using the Struts Source Distribution
------------------------------------
If you wish to contribute to the development of the Struts toolkit, you should
download and install a source distribution of Struts from
. You will also
need a recent nightly build of the Ant project development tool (you *must*
use version 1.3 or later of Ant).
Before committing any changes to the Struts CVS repository, you must do a
"build clean" followed by a "build dist", to ensure that everything compiles
and builds cleanly.