Welcome to Struts
Strutsへようこそ
Welcome to Struts! The goal of this project is to provide an open source framework for building Java web applications.
Strutsへようこそ! このプロジェクトのゴールは、Java Webアプリケーションを構築するための、オープンソースのフレームワークを提供することです。
The core of the Struts framework is a flexible control layer based on standard technologies like Java Servlets, JavaBeans, ResourceBundles, and XML, as well as various Jakarta Commons packages. Struts encourages application architectures based on the Model 2 approach, a variation of the classic Model-View-Controller (MVC) design paradigm.
Strutsフレームワークの中心は、サーブレット、JavaBean、リソースバンドル、XMLや様々な Jakarta Commonsパッケージ等の 標準技術に基づいた柔軟なコントロール層です。 Strutsは、伝統的な Model-View-Controller (MVC) デザインパラダイムの一種であるModel2アプローチに基づいたアプリケーションアーキテクチャを促進します。
Struts provides its own Controller component and integrates with other technologies to provide the Model and the View. For the Model, Struts can interact with standard data access technologies, like JDBC and EJB, as well as most any third-party packages, like Hibernate, iBATIS, or Object Relational Bridge. For the View, Struts works well with JavaServer Pages, including JSTL and JSF, as well as Velocity Templates, XSLT, and other presentation systems.
Strutsは独自のコントローラコンポーネントを提供し、 モデルやビューを構成する他の技術を統合します。 モデルに関しては、JDBCや EJBのような標準データアクセス技術や、Hibernate, iBATIS, Object Relational Bridgeと言った多くのサードパーティパッケージ と接続することができます。 ビューに関しては、 JSTL や JSFを含むJavaServer Pagesだけでなく、 VelocityやXSLT等他のプレゼンテーション機構と組み合わせてもうまく動作します。
The Struts framework provides the invisible underpinnings every professional web application needs to survive. Struts helps you create an extensible development environment for your application, based on published standards and proven design patterns.
Strutsフレームワークは、全ての業務用Webアプリケーションが耐え抜くのに必要な、 目に見えない縁の下の力持ちとしての機能を提供します。 また、標準的で実証済みのデザインパターンに基づき、拡張性の高いアプリケーション開発環境を提供します。
Struts is a project of the The Apache Software Foundation. The official Struts home page is at http://struts.apache.org/.
Strutsは Apacheソフトウェア財団 の1プロジェクトです。 Strutsの公式ホームページは http://struts.apache.org/ です。
Struts is a volunteer project and all support for the framework is provided by unpaid volunteers. This documentation bundle and the mailing lists are the primary ways to learn how to use Struts. The next few pages are devoted to helping you understand what resources are available to you. Since Struts is a volunteer project, and our resources are limited, it is important that we first help you help yourself.
Strutsはボランティアプロジェクトであり、全ては無償のボランティア達により支えられています。 この付属ドキュメントやメーリングリストは、Strutsの使い方を知るための基本です。 この後のページでは、どのようなリソースが利用可能かを知ることができます。 Strutsはボランティアプロジェクトであり、私たちのリソースには限りがあるため、最初にみなさんが自習できるように手助けするのが重要なのです。
Struts in a Nutshell
Struts早分かり
A web application uses a deployment descriptor to initialize resources like servlets and taglibs. The deployment descriptor is formatted as a XML document and named "web.xml". Likewise, Struts uses a configuration file to initialize its own resources. These resources include ActionForms to collect input from users, ActionMappings to direct input to server-side Actions, and ActionForwards to select output pages.
Webアプリケーション では、サーブレットやタグライブラリ 等のリソースを初期化するのに配備記述子を使用します。 配備記述子は"web.xml"というXML形式のファイルとして記述されます。 同様にStrutsは、自分が使用するリソースを初期化するために設定ファイルを使用します。 リソースには、ユーザからの入力を収集するActionFormや、 入力をサーバサイドのAction に振り分ける ActionMapping、 そして出力ページを選択するActionForwardがあります。
Here's a simple Struts configuration (struts-config.xml) for a login workflow:
以下は、ログイン処理のための簡単なStruts設定ファイル(struts-config.xml)です。
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<form-beans>
<form-bean
name="logonForm"
type="app.LogonForm"/>
</form-beans>
<action-mappings>
<action
path="/Welcome"
forward="/pages/Welcome.jsp"/>
<action
path="/Logon"
forward="/pages/Logon.jsp"/>
<action
path="/LogonSubmit"
type="app.LogonAction"
name="logonForm"
scope="request"
validate="true"
input="/Logon.do">
<forward
name="success"
path="/Welcome.do"/>
<forward
name="failure"
path="/Logon.do"/>
</action>
<action
path="/Logoff"
type="app.LogoffAction">
<forward
name="success"
path="/Welcome.do"/>
</action>
</action-mappings>
<message-resources parameter="resources.application"/>
</struts-config>
There are several other resources you can specify in Struts configuration files. You can specify validations for the ActionForms in an XML descriptor, using the Struts Validator. Another extension, Tiles, helps you build pages from smaller fragments.
Struts設定ファイルには、他にもいくつかのリソースを指定出来ます。 Struts Validatorを利用すれば、ActionFormに対するバリデーションをXML記述子で指定出来ます。 また、Tilesは、ページを小さく分割して組み立てるのに役立ちます。
Struts is an extensible framework.
Every class deployed by Struts can be replaced by your own default class.
The properties of your default class can be set using the
Digester's set-property feature.
This is one reason why there are so many contributor extensions for
Struts.
Struts provides a base framework, but you can still write your application your way.
Strutsは拡張可能なフレームワークです。
Strutsが配備する全てのクラスは、利用者独自のデフォルトクラスで置き換えることができます。
Digesterの set-propertyの機能
を使えば、独自クラスのプロパティを設定できます。
このような拡張性の高さは、Strutsにコントリビュートされた拡張機能が非常に多い理由のひとつになっています。
Strutsはベースとなるフレームワークを提供しますが、利用者は今までどおり自分の好きな方法でアプリケーションを作ることが出来ます。
For more about Struts and its underlying technologies, see the User Guide and the Developer Guides.
Struts及び関連する技術についての詳細は、ユーザガイド と開発者ガイドをご覧ください。
Is Struts the best choice for every project?
Strutsは全てのプロジェクトに適するのですか?
No. If you need to write a very simple application, with a handful of pages, then you might consider a "Model 1" solution that uses only server pages.
いいえ。数画面しかない単純なアプリケーションを作るのであれば、JSPのみを利用する"Model 1"アプローチを検討してみてください。
But, if you are writing a more complicated application, with dozens of pages, that need to be maintained over time, then Struts can help. For more about whether Model 1 or or MVC/Model 2 is right for you, see Understanding JavaServer Pages Model 2 architecture and Issues in Struts Adoption.
しかし、もっと複雑で、画面をたくさん持っていて長期に渡って保守する必要があるようなアプリケーションの場合、Strutsが役に立つでしょう。 Model 1 か MVC/Model 2 の選択についての詳細は、 Understanding JavaServer Pages Model 2 architecture や Issues in Struts Adoptionをご覧ください。
Next: Learning About Struts
次: Strutsを学ぶ
Copyright (c) 2000-2004, The Apache Software Foundation