Strutsフレームワーク
ようこそ
トップページ
キックスタートFAQ
ユーザガイド
リソース
私たちは誰でしょう
ダウンロード
バイナリ
ソースコード
はじめよう
インストール
リリースノート
APIドキュメント
メーリングリスト
バグ データベース
開発者ガイド
Beanタグ
HTMLタグ
Logicタグ
Templateタグ
Digester
Utilities
タグライブラリ ドキュメント
Beanタグ
HTMLタグ
Logicタグ
Templateタグ
現在の開発
インストール(ナイトリビルド)
リリースノート(ナイトリビルド)
APIドキュメント(ナイトリビルド)
ワークフローの提案
TODOリスト
Prerequisite Software

前提となるソフトウェア

In order to build a Struts source distribution, or install and use a Struts binary distribution, you will need to acquire and install several other software packages, as follows:


Strutsソースディストリビューションをビルドしたり、または、バイナリーディストリビューションをインストールして利用するために、下記のようにいくつかのソフトウェアパッケージを別途入手しインストールする必要があります:

  • Java Development Kit - You must 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 http://java.sun.com/j2se.

  • Java開発キット - あなたのオペレーティングシステムの環境に合ったJava 開発キット、 Java2(version 1.2か、それ以降) をダウンロードしてインストールする必要があります。 Java開発キットのディストリビューションについては http://java.sun.com/j2seからはじめるとよいでしょう。
  • Servlet Container - You must 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 Tomcat (version 3.1 or later required, version 3.2 or later recommended).

  • Servletコンテナ -Servlet API仕様(Version2.2かそれ以降)、 JavaServer Pages (JSP)仕様(Version1.1かそれ以降)に準拠したServletコンテナをダウンロードしてインストールする必要があります。 一つのポピュラーな選択としては、Apacheの Tomcat (version 3.1以上が必要、version 3.2以上を推奨)があります。
  • Ant Build System - If you are building Struts from the source distribution, you must download and install version 1.3 or later of the Ant build system. This package is also strongly recommended for use in developing your own web applications based on Struts.
    • If you are using the release version of Ant version 1.3, you will also need to download the "optional.jar" file that contains the implementation of Ant's <style> command.
    • Make sure that the "ant" and "ant.bat" scripts are executable, by adding the $ANT_HOME/bin directory to your PATH environment variable.

  • Ant ビルドシステム - ソースディストリビューションからStrutsをビルドする場合は、 version 1.3かそれ以降の Ant ビルドシステムをダウンロードしてインストールする必要があります。 Strutsを使ってあなた自身のWebアプリケーションを構築する際にも、このパッケージを使用することを強くお勧めします。
    • Ant Version1.3を利用している場合は、<style>コマンドを実装している "optional.jar" もダウンロードする必要があります。
    • $ANT_HOME/binディレクトリをPATH環境変数に加えて、"ant" と "ant.bat" スクリプトが実行可能であることを確認してください。
  • Servlet API Classes - In order to compile Struts itself, or applications that use Struts, you will need a servlet.jar 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 here.

  • Servlet APIクラス - Struts自身やStrutsを利用するアプリケーションをコンパイルするために、 ServletやJSP APIクラスを含んだservlet.jarファイルを用意する必要があります。 大部分のServletコンテナはこのJARファイルを含んでいます。 別の方法としては、Servlet APIクラスのディストリビューションを こちら から得ることもできます。
  • JDBC 2.0 Optional Package Classes - Struts supports an optional implementation of javax.sql.DataSource, so it requires the API classes to be compiled. They can be downloaded from http://java.sun.com/products/jdbc/download.html.

  • JDBC 2.0拡張パッケージクラス - Strutsはjavax.sql.DataSource の拡張実装をサポートします。よって、コンパイルするために拡張APIクラスを必要とします。 これらは、http://java.sun.com/products/jdbc/download.html からダウンロード可能です。
  • XML Parser - Struts requires the presence of an XML parser that is compatible with the Java API for XML Parsing (JAXP) specification, 1.0 or later. You can download and install the JAXP reference implementation, which is required for building the Struts source distribution. In Struts-based web applications, you may replace the reference implementation classes with any other JAXP compliant parser, such as Xerces. See detailed instructions related to the parser in the instructions for building and installing Struts, below.

  • XMLパーサ - Strutsは、 XMLパースのためのJava API(JAXP)仕様1.0かそれ以降と互換性のあるXMLパーサを必要とします。 Strutsソースディストリビューションをビルドするために必要なJAXPの リファレンス実装 ダウンロードすることができます。 Strutsベースのwebアプリケーションでは、リファレンス実装のクラスを Xercesのような他のJAXP準拠パーサに置き換えてもよいです。 パーサの命令に関する詳細は、下記のStrutsのビルドインストール のための手引きをご覧下さい。
  • Xalan XSLT Processor - If you are building Struts from the source distribution, you must download and install version 1.2 (problems have been reported with current versions of Xalan 2.0) of the Xalan XSLT processor (which also includes the Xerces XML parser), or use the version of Xalan included in the JAXP 1.1 release. This processor is used to convert the Struts documentation from its internal XML-based format into the HTML that is presented in the Struts documentation application.

  • Xalan XSLT プロセッサ - もし、ソースディストリビューションから Strutsをビルドするのであれば、 Xalan XSLT プロセッサ (Xerces XML parserを含む)version 1.2か、 JAXP 1.1に含まれるXalanをダウンロードしてインストールする必要があります(現在のXalan 2.0には問題が報告されています)。 XSLTプロセッサは、Strutドキュメントアプリケーションで内部的にXMLをHTMLに変換するのに、利用されます。
Building Struts From Source

ソースからのStrutsのビルド

First, download a source distribution of Struts by following the instructions here. Then, make sure you have downloaded and installed all of the prerequisite software packages described above.


まず、 ここの手引きにしたがってStrutsのソースディストリビューションをダウンロードします。 それから、 前に述べた前提となるソフトウェア パッケージを全てダウンロードしてインストールします。

To build Struts, you will need to customize the build process to the details of your development environment as follows:


Strutsをビルドするためには、以下のように開発環境にあわせてビルドの手順をカスタマイズする必要があります:

  • The Struts source distribution uses a file named build.properties (in the top-level directory of the distribution) to identify the location of external components that Struts depends on.

  • Strutsソースディストリビューションはbuild.properties ファイル(ディストリビューションのトップレベルディレクトリにあります)を利用して、 Strutsが依存する外部コンポーネントの場所を認識します。
  • There is no build.properties file included with the source distribution. However, there is an example file named build.properties.example that you can copy to build.properties and then customize.

  • ソースディストリビューションにはbuild.propertiesファイルは含まれません。 しかし、build.properties.exampleというサンプルファイルがあります。 これをbuild.properties ファイルとしてコピーしてカスタマイズして利用できます。
  • The properties you must configure in build.properties are:
    • catalina.home - Pathname to the directory of your binary distribution of Tomcat 4.0 (required only if you wish to use the deploy.catalina target).
    • servletapi.home - Pathname to the directory of your binary distribution of the Servlet API classes.
    • tomcat.home - Pathname to the directory of your binary distribution of Tomcat 3.2 (required only if you wish to use the deploy.tomcat target).
    • xerces.home - Pathname to the directory of your binary distribution of the Xerces parser, version 1.2 or 1.3 (required only if you wish to use the deploy.catalina target).

  • build.propertiesファイルの中で設定しなければならないプロパティは:
    • catalina.home - Tomcat4.0のバイナリディストリビューションのディレクトリパス名 (deploy.catalinaターゲットを使いたいときだけ必要です)
    • servletapi.home - Servlet APIクラスのディレクトリパス名
    • tomcat.home - Tomcat 3.2のバイナリディストリビューションのディレクトリパス名 (deploy.tomcatターゲットを使いたいときだけ必要です)
    • xerces.home - Xercesパーサ version 1.2 または 1.3のディレクトリパス名 ( deploy.catalinaターゲットを使いたいときだけ必要です)
  • If you are a Struts developer with write access to the CVS repository, be sure that you do NOT check in a copy of the build.properties file, since it will be different for each individual developer.

  • もし、あなたがCVSリポジトリへの書き込みアクセスができるStruts開発者ならば、 build.propertiesファイルのコピーをチェックイン しないように注意してください。 (このファイルは各々の開発者ごとに違うはずなので)

To build a "distribution" version of Struts, first change your current directory to the directory in which you have unpacked the Struts source distribution, and (if necessary) create or customize the build.properties file as described above. Then, type:

        ant dist

Strutsの "ディストリビューション" をビルドするには、 まずStrutsソースディストリビューションを展開したディレクトリに移動してください。 そして、(必要であれば)build.propertiesファイルを上記に示したように、作成したりカスタマイズしてください。 そしてこのように入力してください。:

        ant dist

This command will create a binary distribution of Struts, in a directory named dist (relative to where you are compiling from). This directory contains an exact replica of the files included in a binary distribution of Struts, as described in the following section.


このコマンドは、 distディレクトリ(どこでコンパイルしたかに依存する)にStrutsのバイナリディストリビューションを作成します。 このディレクトリは、 次のセクションで説明するStrutsバイナリディストリビューションと全く同じファイルを含んでいます。

IMPORTANT NOTE: The struts.jar must be in your classpath when compiling Struts. The build.xml provided does this automatically. If you use your development machine to test Struts application locally, be sure that the stuts.jar is NOT on your classpath when your container is running.


要注意: Strutsをコンパイルする際struts.jarをクラスパスに含めなければなりません。 ソースディストリビューションに用意されているbuild.xmlは、これを自動的に行ってくれます。 開発マシンを使ってStrutsアプリケーションをローカルでテストする場合は、 コンテナが動作時にstuts.jarをクラスパスに 含めないようにしてください。

Install A Struts Binary Distribution

Strutsバイナリディストリビューションのインストール

First, download a binary distribution of Struts by following the instructions here. Then, make sure you have downloaded and installed all of the prerequisite software packages described above.


まず、ここの手引きに従ってStrutsのバイナリディストリビューションをダウンロードします。 それから、前に述べた前提となるソフトウェアパッケージをダウンロードしインストールします。

Unpack the Struts binary distribution into a convenient directory. (If you build Struts from the source distribution, the result of the build will already be an unpacked binary distribution for you). The distribution consists of the following contents:


Strutsバイナリディストリビューションを適当なディレクトリに展開します。 (もしソースディストリビューションからStrutsをビルドしたのなら、ビルドの結果はバイナリディストリビューションを展開したのと既に同じ状態になっています)。 ディストリビューションの内容は以下のとおりです:

  • lib/struts.jar - This JAR file contains all of the Java classes included in Struts. It should be copied into the WEB-INF/lib directory of your web application. WARNING - If you are going to be hosting multiple Struts based applications on the same servlet container, you will be tempted to place the struts.jar file into the shared repository supported by your container. Be advised that this will like cause you to encounter ClassNotFoundException problems unless all of your application classes are stored in the shared repository.

  • lib/struts.jar - このJARファイルはStrutsの全てのJavaクラスを含んでいます。 このファイルを、あなたのWebアプリケーションのWEB-INF/lib ディレクトリにコピーしてください。 警告 - 同じServletコンテナ上で複数のStrutsをベースとしたアプリケーションを動作させるのであれば、 struts.jarファイルをコンテナのサポートする共有リポジトリに配置したくなるでしょう。 その場合、アプリケーションの全てのクラスを共有リポジトリに格納しなければ ClassNotFoundException問題を引き起こす原因となることを忠告します。
  • lib/struts*.tld - These are the "tag library descriptor" files that describe the custom tags in the various Struts tag libraries. They should be copied into the WEB-INF directory of your web application.

  • lib/struts*.tld - これらは、"タグライブラリ記述子"(さまざまなStrutsタグライブラリの中のカスタムタグを記述したもの)です。 これらのファイルをあなたのWebアプリケーションの WEB-INFディレクトリにコピーしてください。
  • webapps/struts-blank.war - This is a simple "web application archive" file containing a basic starting point for building your own Struts-based applications.

  • webapps/struts-blank.war - これは、Strutsベースのアプリケーションを作る際の出発点となる、 シンプルな "Webアプリケーションアーカイブ"ファイルです。
  • webapps/struts-documentation.war - This is a "web application archive" file containing all of the Struts documentation found on the Struts web site (including these pages). You can install this web application on any servlet container compatible with Servlet API 2.2 or later.

  • webapps/struts-documentation.war - これは、 Struts web サイトにあるStrutsドキュメントの全てを含んだ "Webアプリケーションアーカイブ"ファイルです(このページも含みます)。 Servlet API 2.2以降互換のServletコンテナにインストールすることができます。
  • webapps/struts-example.war - This is an example web application that uses a large percentage of Struts features. You can install this web application on any servlet container compatible with the Servlet 2.2 (or later) and JSP 1.1 (or later) specifications. If an XML parser is not made available to web applications by your container, you will need to add one to the WEB-INF/lib directory of this web application.

  • webapps/struts-example.war - これは、 Strutsの機能の大部分を利用したサンプルWebアプリケーションです。 Servlet 2.2(またはそれ以降)、JSP 1.1(またはそれ以降)互換のServletコンテナにインストールすることができます。 もし、あなたのコンテナにおいてwebアプリケーションがXMLパーサを利用できないのであれば、 そのwebアプリケーションのWEB-INF/libディレクトリにXMLパーサを追加する必要があります。
  • webapps/struts-exercise-taglib.war - This web application contains test pages for the various custom tags supported by Struts. It is primarily of use to developers who are enhancing the Struts custom tag libraries, but may also be useful as simple examples of the usage of various Struts tags.

  • webapps/struts-exercise-taglib.war - このwebアプリケーションは、 Strutsのサポートするさまざまなカスタムタグのためのテストページを含んでいます。 これは、Strutsカスタムタグを拡張しようとする開発者のためになりますし、 さまざまなStrutsタグの利用方法の簡単なサンプルとしても有用でしょう。
  • webapps/struts-template.war - This web application both introduces and demonstrates the Struts template tags.

  • webapps/struts-template.war - このwebアプリケーションは、 Strutsテンプレートタグの紹介とデモです。
  • webapps/struts-upload.war - This web application is a quick example of uploading files using the Struts framework.

  • webapps/struts-upload.war - このwebアプリケーションは、 Strutsフレームワークを用いたファイルのアップロードの簡単なサンプルです。

To use Struts in your own application, you will need to follow these steps:


あなたのアプリケーションでStrutsを使うには、以下のステップに従ってください:

  • Copy the file lib/struts.jar from the Struts distribution into the WEB-INF/lib directory of your web application.

  • lib/struts.jarを、Strutsのディストリビューションから、 あなたのwebアプリケーションのWEB-INF/lib ディレクトリにコピーしてください。
  • Copy the all of the files that match lib/struts*.tld from the Struts distribution into the WEB-INF directory of your web application.

  • Strutsのディストリビューションからlib/struts*.tldに一致する全てのファイルを、 あなたのwebアプリケーションのWEB-INF ディレクトリにコピーしてください。
  • Modify the WEB-INF/web.xml file for your web application to include a <servlet> element to define the controller servlet, and a <servlet-mapping> element to establish which request URIs are mapped to this servlet. Use the WEB-INF/web.xml file from the Struts example application for a detailed example of the required syntax.

  • あなたのwebアプリケーションのWEB-INF/web.xmlファイルを修正して<servlet> 要素を追加し、コントローラサーブレットを定義します。 そして<servlet-mapping>要素を追加し、どのリクエストURIがこのServletにマップするのかを確立させます。 StrutsサンプルアプリケーションのWEB-INF/web.xmlファイルを、 必要なシンタックスの詳細なサンプルとして利用してください。
  • Modify the WEB-INF/web.xml file of your web application to include the following tag library declarations:

  • あなたのwebアプリケーションのWEB-INF/web.xmlファイルを修正して、 以下のタグライブラリ宣言を含めるようにしてください:
<taglib>
  <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
  <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>

<taglib>
  <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
  <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>

<taglib>
  <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
  <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>

<taglib>
  <taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
  <taglib-location>/WEB-INF/struts-template.tld</taglib-location>
</taglib>
  • Create a file WEB-INF/struts-config.xml that defines the action mappings and other characteristics of your specific application. You can use the struts-config.xml file from the Struts example application for a detailed example of the required syntax.

  • アプリケーション固有のアクションマッピングやその他の特徴を定義する WEB-INF/struts-config.xmlファイルを作成します。 Strutsサンプルアプリケーションのstruts-config.xmlファイルを、 必要なシンタックスの詳細なサンプルとして利用してください。
  • At the top of each JSP page that will use the Struts custom tags, add line(s) declaring the Struts custom tag libraries used on this particular page, like this:

  • Strutsカスタムタグを使う各JSPページの先頭に、下記のようにStrutsカスタムタグライブラリの宣言文を追加します:
<@ taglib uri="/WEB-INF/struts-bean.tld" prefix="struts-bean" %>
<@ taglib uri="/WEB-INF/struts-html.tld" prefix="struts-html" %>
<@ taglib uri="/WEB-INF/struts-logic.tld" prefix="struts-logic" %>
<@ taglib uri="/WEB-INF/struts-template.tld" prefix="struts-template" %>
  • When compiling the Java classes that comprise your application, be sure to include the struts.jar file (copied earlier) on the CLASSPATH that is submitted to the compiler.

  • あなたのアプリケーションを構成するJavaクラスをコンパイルする際、 (先ほどコピーした)struts.jarファイルをコンパイラが認識するCLASSPATHに確実に追加してください。
Installing Struts with your servlet container

サーブレットコンテナにStrutsをインストールする

WARNING - Do NOT add struts.jar to the classpath of your servlet container in an attempt to avoid placing it in the /WEB-INF/lib directory of each individual web app! Doing so will cause problems with ClassNotFoundException exceptions.


警告 - 個々のWebアプリケーションの/WEB-INF/libstruts.jarを配置するのを避けようとして、 サーブレットコンテナのクラスパスにstruts.jarを追加しないでください。 そのようなことをすればClassNotFoundExceptionの問題が引き起こされるでしょう。

For most containers, you need only to:


多くのコンテナでは、以下の作業のみ必要です:

  • Copy the WAR files in your Struts /webapp directory to your containers webapps directory.
  • In some cases, you may need to restart your container if it is running.

  • Strutsの/webappディレクトリにあるWARファイルをコンテナのwebappsディレクトリにコピーします。
  • 場合によっては、コンテナの再起動が必要です。

Status of various containers


さまざまなコンテナの状況



[訳注: これは芦沢 嘉典が翻訳しました。日本語訳に対するコメントがあれば、こちらに送って下さい。]
Copyright (c) 2000-2002, Apache Software Foundation