|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.apache.struts.action.ActionServlet
ActionServletは、 "モデル2"として一般に知られている、 WEBアプリケーションのためのモデル-ビュー-コントローラ(MVC)デザインパターンの"コントローラ"を提供します。 この命名の起源はJavaServerPages仕様の0.92の記述であり、 (他に適当な名前がないため)それ以来ずっと続いています。
ActionServlet provides the "controller" in the Model-View-Controller (MVC) design pattern for web applications that is commonly known as "Model 2". This nomenclature originated with a description in the JavaServerPages Specification, version 0.92, and has persisted ever since (in the absence of a better name).
"モデル2"アプリケーションのアーキテクチャは概ね次の通りです。:
Generally, a "Model 2" application is architected as follows:
RequestProcessorオブジェクトへリクエストの扱いを移譲します。
このコンポーネントはMVCアーキテクチャの"コントローラ"コンポーネントを実現します。RequestProcessorは、
要求されたビジネスロジックを処理するActionクラスを選択して実行するか、
または別のリソースへレスポンスを移譲します。RequestProcessor selects and invokes an @link(Action) class to perform
the requested business logic, or delegates the response to another resource.Actionクラスは、
アプリケーションのユーザとの相互作用の状態を扱うことができます。
この典型例として、
(どれぐらいの期間必要かにより)リクエストまたはセッション属性に蓄積されるJavaBeansを生成したり変更する事があります。
この様なJavaBeansは、MVCアーキテクチャの"モデル"コンポーネントを実現します。Action classes can manipulate the state of the application's
interaction with the user, typically by creating or modifying JavaBeans
that are stored as request or session attributes (depending on how long
they need to be available). Such JavaBeans represent the "model"
component of an MVC architecture.Actionクラスは、
レスポンスを扱うべきリソースを指すActionForwardを一般に返します。
Actionがnullを返さない場合、
ユーザインタフェースの遷移先のページを生成するために、
(RequestDispatcher.forwardまたはResponse.sendRedirectを活用して)
RequestProcessorは、指定されたリソースへフォワードまたはリダイレクトします。Action classes generally return an @link(ActionForward) to indicate
which resource should handle the response. If the Action
does not return null, the RequestProcessor forwards or
redirects to the specified resource (by utilizing
RequestDispatcher.forward or Response.sendRedirect)
so as to produce the next page of the user interface.RequestsProcessorの標準バージョンは、
各HTTPリクエストに対する以下のようなロジックを実装しています。
このオブジェクトをサブクラス化して独自の処理を実装するために、
いくつかまたは全ての機能をオーバーライドすることができます。
The standard version of RequestsProcessor implements the
following logic for each incoming HTTP request. You can override
some or all of this functionality by subclassing this object and
implementing your own version of the processing.
Actionインタフェースを実装した)
対応するアクションクラスのクラス名を決定します。Action interface).
Actionクラスへ最初のリクエストがあると、
そのクラスのインスタンスを生成するとともに将来に備えてキャッシュします。Action class,
instantiate an instance of that class and cache it for future use.ActionForm Beanのプロパティを設定します。ActionForm bean
associated with this mapping.Actionクラスのexecuteメソッドを呼び出し、
使用されるマッピングを参照して、
(もしあれば)関連したフォームBeanと、
リクエストとレスポンスがサーブレットコンテナによりコントローラに渡されます。
(そのためサーブレットコンテキストと同様に、
マッピング自身のどのような限定されたプロパティへもアクセスを提供します。)execute method of this Action class, passing
on a reference to the mapping that was used, the relevant form-bean
(if any), and the request and the response that were passed to the
controller by the servlet container (thereby providing access to any
specialized properties of the mapping itself as well as to the
ServletContext).
ActionServletの標準バージョンは、
Webアプリケーション用の配備記述ファイル(/WEB-INF/web.xml)で規定された、
以下のサーブレット初期化パラメータをもとに初期化されます。
このサーブレットのサブクラスでは、
追加の初期化パラメータを自由に定義できます。
The standard version of ActionServlet is configured based
on the following servlet initialization parameters, which you will specify
in the web application deployment descriptor (/WEB-INF/web.xml)
for your application. Subclasses that specialize this servlet are free to
define additional initialization parameters.
ModuleConfigインタフェースの実装を生成するために使用されるModuleConfigFactoryのクラス名です。
[org.apache.struts.config.impl.DefaultModuleConfigFactory]
ModuleConfigFactory used to create the implementation of the
ModuleConfig interface.
[org.apache.struts.config.impl.DefaultModuleConfigFactory]
java.lang.Integerの様な)数値型に関するラッパクラスは(0ではなく)nullに設定されます。
(Struts 1.1以降) [false] java.lang.Integer) will default to null (rather than 0).
(Since Struts 1.1) [false] struts-config.xmlファイルを処理するDigesterに加えるべき、
org.apache.commons.digester.RuleSetインスタンスに追加する十分適格なクラス名のカンマで区切られたリストです。
デフォルトでは、
標準設定要素のRuleSetがロードされるだけです。
(Struts 1.1以降)org.apache.commons.digester.RuleSet
instances that should be added to the Digester that will
be processing struts-config.xml files. By default, only
the RuleSet for the standard configuration elements is
loaded. (Since Struts 1.1)
| フィールドの概要 | |
protected java.lang.String |
config
デフォルトモジュールのための設定リソースへのコンテキスト相対パスのカンマで区切られたリスト。 |
protected org.apache.commons.digester.Digester |
configDigester
Struts設定ファイルからModuleConfigオブジェクトを生成するために使用されるDigester。 |
protected boolean |
convertNull
ラッパクラス型に関するフォームBeanのプロパティにおける振る舞いの下位互換性の対応要求フラグ。 |
protected org.apache.commons.collections.FastHashMap |
dataSources
もしあれば、 保存される際のサーブレットコンテキスト属性名をキーとする、 このモジュールで設定されたJDBCデータソース。 |
protected MessageResources |
internal
内部リソースのためのリソースオブジェクト。 |
protected java.lang.String |
internalName
内部リソースの基本クラス名。 |
protected static org.apache.commons.logging.Log |
log
Commons Loggingのインスタンス。 |
protected RequestProcessor |
processor
全てのリクエストを処理するために使用する RequestProcessorのインスタンス。 |
protected java.lang.String[] |
registrations
使用すべき設定ファイルのDTDのバージョンを表すための、 公開された識別子と対応するリソース名のセットです。 |
protected java.lang.String |
servletMapping
Webアプリケーションの配備記述子で設定されたURLパターン。 |
protected java.lang.String |
servletName
Webアプリケーションの配備記述子で登録されているサーブレット名。 |
| クラス javax.servlet.http.HttpServlet から継承したフィールド |
|
| コンストラクタの概要 | |
ActionServlet()
|
|
| メソッドの概要 | |
private void |
addRuleSets()
rulesets初期化パラメータで指定されたconfigDigesterに、
全てのカスタムRuleSetのインスタンスを追加します
{@primary Add any custom RuleSet instances to configDigester that have
been specified in the rulesets init parameter. |
void |
addServletMapping(java.lang.String servletName,
java.lang.String urlPattern)
このサーブレット用である場合、 Webアプリケーションの配備記述子からサーブレットマッピングを設定します。 |
void |
destroy()
このコントローラサーブレットを速やかに停止し、 初期化時に確保されたあらゆるリソースを解放します。 |
protected void |
destroyConfigDigester()
生成されたconfigDigesterのインスタンスを全て速やかに解放します。 |
protected void |
destroyInternal()
内部のMessageResourcesの使用を速やかに終了します。 |
protected void |
destroyModules()
(もしあれば) このアプリケーションに関連づけられた全てのモジュールの使用を速やかに終了します。 |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
HTTPの"GET"リクエストを処理します。 |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
HTTPの"POST"リクエストを処理します。 |
MessageResources |
getInternal()
内部メッセージの文字列を含む MessageResourcesのインスタンスを返します。 |
protected ModuleConfig |
getModuleConfig(javax.servlet.http.HttpServletRequest request)
現在選択されているモジュールのモジュール設定オブジェクトを返します。 |
private RequestProcessor |
getProcessorForModule(ModuleConfig config)
与えられたモジュールのRequestProcessorを返し、 存在しない場合はnullを返します。 |
protected RequestProcessor |
getRequestProcessor(ModuleConfig config)
指定されたモジュールに関係する RequestProcessorを探して、
必要に応じて新たに生成し、
返します。 |
private void |
handleConfigException(java.lang.String path,
java.lang.Exception e)
parseModuleConfigFileメソッドにおける例外の扱いを簡略化します。 |
void |
init()
このサーブレットを初期化します。 |
protected org.apache.commons.digester.Digester |
initConfigDigester()
Strutsモジュール設定ファイルの処理されて、 (解析が行われる前に評価スタックに入れられるべき) 対応する ModuleConfigオブジェクトの設定で初期化された、
新たなDigesterインスタンスを(必要に応じて)生成して返します。 |
protected void |
initInternal()
内部のMessageResourcesの纏まりを初期化します。 |
protected ModuleConfig |
initModuleConfig(java.lang.String prefix,
java.lang.String paths)
指定されたモジュールのモジュール設定情報を初期化します。 |
protected void |
initModuleConfigFactory()
モジュール設定を生成するために使用されるファクトリを初期化します。 |
protected void |
initModuleDataSources(ModuleConfig config)
指定されたモジュールのデータソースを初期化します。 |
protected void |
initModuleMessageResources(ModuleConfig config)
指定されたモジュールのアプリケーション MessageResourcesを初期化します。 |
protected void |
initModulePlugIns(ModuleConfig config)
指定されたモジュールのプラグインを初期化します。 |
protected void |
initModulePrefixes(javax.servlet.ServletContext context)
Globals.MODULE_PREFIXES_KEYに基づき、 サーブレットコンテキスト内のモジュールプレフィックスであるString[]を保存します 注意 - デフォルトモジュールのためのプレフィックスである""はこのリスト中に含まれません。 |
protected void |
initOther()
コントローラサーブレットの他のグローバル特性を初期化します。 |
protected void |
initServlet()
コントローラサーブレットがアクセスするサーブレットマッピングを初期化します。 |
private boolean |
isValidating()
validatingの初期化パラメータの状態を確認します。 |
protected void |
parseModuleConfigFile(org.apache.commons.digester.Digester digester,
java.lang.String path)
モジュール設定ファイルを解析します。 |
protected void |
process(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
このリクエストに対する標準的なリクエスト処理を実行して、 対応するレスポンスを生成します。 |
| クラス javax.servlet.http.HttpServlet から継承したメソッド |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
| クラス javax.servlet.GenericServlet から継承したメソッド |
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
protected java.lang.String config
デフォルトモジュールのための設定リソースへのコンテキスト相対パスのカンマで区切られたリスト。
Comma-separated list of context-relative path(s) to our configuration resource(s) for the default module.
protected org.apache.commons.digester.Digester configDigester
Struts設定ファイルからModuleConfigオブジェクトを生成するために使用されるDigester。
The Digester used to produce ModuleConfig objects from a Struts configuration file.
protected boolean convertNull
ラッパクラス型に関するフォームBeanのプロパティにおける振る舞いの下位互換性の対応要求フラグ。
The flag to request backwards-compatible conversions for form bean properties of the Java wrapper class types.
protected org.apache.commons.collections.FastHashMap dataSources
もしあれば、 保存される際のサーブレットコンテキスト属性名をキーとする、 このモジュールで設定されたJDBCデータソース。
The JDBC data sources that has been configured for this module, if any, keyed by the servlet context attribute under which they are stored.
protected MessageResources internal
内部リソースのためのリソースオブジェクト。
The resources object for our internal resources.
protected java.lang.String internalName
内部リソースの基本クラス名。
The Java base name of our internal resources.
protected static org.apache.commons.logging.Log log
Commons Loggingのインスタンス。
Commons Logging instance.
protected RequestProcessor processor
全てのリクエストを処理するために使用するRequestProcessorのインスタンス。
The RequestProcessor instance we will use to process
all incoming requests.
protected java.lang.String[] registrations
使用すべき設定ファイルのDTDのバージョンを表すための、 公開された識別子と対応するリソース名のセットです。 このリストの数は必ず偶数であること!
The set of public identifiers, and corresponding resource names, for the versions of the configuration file DTDs that we know about. There MUST be an even number of Strings in this list!
protected java.lang.String servletMapping
Webアプリケーションの配備記述子で設定されたURLパターン。
The URL pattern to which we are mapped in our web application deployment descriptor.
protected java.lang.String servletName
Webアプリケーションの配備記述子で登録されているサーブレット名。
The servlet name under which we are registered in our web application deployment descriptor.
| コンストラクタの詳細 |
public ActionServlet()
| メソッドの詳細 |
public void destroy()
このコントローラサーブレットを速やかに停止し、 初期化時に確保されたあらゆるリソースを解放します。
Gracefully shut down this controller servlet, releasing any resources that were allocated at initialization.
public void init()
throws javax.servlet.ServletException
このサーブレットを初期化します。 ほとんどの処理はサポートメソッドに分解されているので、 かなり細かいレベルの機能毎にオーバライドできます。
Initialize this servlet. Most of the processing has been factored into support methods so that you can override particular functionality at a fairly granular level.
javax.servlet.ServletException - 正しく初期化できなかった場合
protected void initModulePrefixes(javax.servlet.ServletContext context)
Globals.MODULE_PREFIXES_KEYに基づき、 サーブレットコンテキスト内のモジュールプレフィックスであるString[]を保存します 注意 - デフォルトモジュールのためのプレフィックスである""はこのリスト中に含まれません。
Saves a String[] of module prefixes in the ServletContext under Globals.MODULE_PREFIXES_KEY. NOTE - the "" prefix for the default module is not included in this list.
context - サーブレットコンテキスト
public void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException,
javax.servlet.ServletException
HTTPの"GET"リクエストを処理します。
Process an HTTP "GET" request.
request - 処理中のサーブレットリクエスト
response - 生成するサーブレットレスポンス
java.io.IOException - 入出力エラーが発生した場合
javax.servlet.ServletException - サーブレットで例外が発生した場合
public void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException,
javax.servlet.ServletException
HTTPの"POST"リクエストを処理します。
Process an HTTP "POST" request.
request - 処理中のサーブレットリクエスト
response - 生成するサーブレットレスポンス
java.io.IOException - 入出力エラーが発生した場合
javax.servlet.ServletException - サーブレットで例外が発生した場合
public void addServletMapping(java.lang.String servletName,
java.lang.String urlPattern)
このサーブレット用である場合、 Webアプリケーションの配備記述子からサーブレットマッピングを設定します。
Remember a servlet mapping from our web application deployment descriptor, if it is for this servlet.
servletName - マップされているサーブレットの名前
urlPattern - このサーブレットにマップされているURLパターン
public MessageResources getInternal()
内部メッセージの文字列を含むMessageResourcesのインスタンスを返します。
Return the MessageResources instance containing our
internal message strings.
protected void destroyModules()
(もしあれば) このアプリケーションに関連づけられた全てのモジュールの使用を速やかに終了します。
Gracefully terminate use of any modules associated with this application (if any).
protected void destroyConfigDigester()
生成されたconfigDigesterのインスタンスを全て速やかに解放します。
Gracefully release any configDigester instance that we have created.
protected void destroyInternal()
内部のMessageResourcesの使用を速やかに終了します。
Gracefully terminate use of the internal MessageResources.
protected ModuleConfig getModuleConfig(javax.servlet.http.HttpServletRequest request)
現在選択されているモジュールのモジュール設定オブジェクトを返します。
Return the module configuration object for the currently selected module.
request - 処理中のサーブレットリクエスト
protected RequestProcessor getRequestProcessor(ModuleConfig config)
throws javax.servlet.ServletException
指定されたモジュールに関係するRequestProcessorを探して、
必要に応じて新たに生成し、
返します。
Look up and return the {@link RequestProcessor} responsible for the specified module, creating a new one if necessary.
config - 取得してRequestProcessorを返すためのモジュールの設定
javax.servlet.ServletException - RequestProcessorのインスタンスを生成できない場合
private RequestProcessor getProcessorForModule(ModuleConfig config)
与えられたモジュールのRequestProcessorを返し、 存在しない場合はnullを返します。 このメソッドはRequestProcessorを生成しません。
Returns the RequestProcessor for the given module or null if one does not exist. This method will not create a RequestProcessor.
config - ModuleConfig
protected void initModuleConfigFactory()
モジュール設定を生成するために使用されるファクトリを初期化します。
Initialize the factory used to create the module configuration.
protected ModuleConfig initModuleConfig(java.lang.String prefix,
java.lang.String paths)
throws javax.servlet.ServletException
指定されたモジュールのモジュール設定情報を初期化します。
Initialize the module configuration information for the specified module.
prefix - このモジュールのモジュールプレフィックス
paths - このモジュールの設定リソースのためのコンテキスト相対パスのカンマで区切られたリスト
javax.servlet.ServletException - 初期化が実行できなかった場合
protected void parseModuleConfigFile(org.apache.commons.digester.Digester digester,
java.lang.String path)
throws javax.servlet.UnavailableException
モジュール設定ファイルを解析します。
Parses one module config file.
digester - 解析するためのDigesterインスタンス
path - 解析する設定ファイルへのパス
javax.servlet.UnavailableException - ファイルが読めないかまたは解析できない場合
private void handleConfigException(java.lang.String path,
java.lang.Exception e)
throws javax.servlet.UnavailableException
parseModuleConfigFileメソッドにおける例外の扱いを簡略化します。
Simplifies exception handling in the parseModuleConfigFile method.
path - e -
javax.servlet.UnavailableException - 例外のラッパ
protected void initModuleDataSources(ModuleConfig config)
throws javax.servlet.ServletException
指定されたモジュールのデータソースを初期化します。
Initialize the data sources for the specified module.
config - このモジュールのModuleConfig情報
javax.servlet.ServletException - 初期化が実行できなかった場合
protected void initModulePlugIns(ModuleConfig config)
throws javax.servlet.ServletException
指定されたモジュールのプラグインを初期化します。
Initialize the plug ins for the specified module.
config - このモジュールのModuleConfig情報
javax.servlet.ServletException - 初期化が実行できなかった場合
protected void initModuleMessageResources(ModuleConfig config)
throws javax.servlet.ServletException
指定されたモジュールのアプリケーションMessageResourcesを初期化します。
Initialize the application MessageResources for the specified
module.
config - このモジュールのModuleConfig情報
javax.servlet.ServletException - 初期化が実行できなかった場合
protected org.apache.commons.digester.Digester initConfigDigester()
throws javax.servlet.ServletException
Strutsモジュール設定ファイルの処理されて、
(解析が行われる前に評価スタックに入れられるべき)
対応するModuleConfigオブジェクトの設定で初期化された、
新たなDigesterインスタンスを(必要に応じて)生成して返します。
Create (if needed) and return a new Digester
instance that has been initialized to process Struts module
configuration files and configure a corresponding ModuleConfig
object (which must be pushed on to the evaluation stack before parsing
begins).
javax.servlet.ServletException - Digesterが設定できなかった場合
private void addRuleSets()
throws javax.servlet.ServletException
rulesets初期化パラメータで指定されたconfigDigesterに、
全てのカスタムRuleSetのインスタンスを追加します
Add any custom RuleSet instances to configDigester that have
been specified in the rulesets init parameter.
javax.servlet.ServletExceptionprivate boolean isValidating()
validatingの初期化パラメータの状態を確認します。
Check the status of the validating initialization parameter.
protected void initInternal()
throws javax.servlet.ServletException
内部のMessageResourcesの纏まりを初期化します。
Initialize our internal MessageResources bundle.
javax.servlet.ServletException - これらのリソースを初期化できなかった場合
protected void initOther()
throws javax.servlet.ServletException
コントローラサーブレットの他のグローバル特性を初期化します。
Initialize other global characteristics of the controller servlet.
javax.servlet.ServletException - これらのリソースを初期化できなかった場合
protected void initServlet()
throws javax.servlet.ServletException
コントローラサーブレットがアクセスするサーブレットマッピングを初期化します。
これは、
フォームを送信するための適切な遷移先のURLを生成する、
&html:form>タグで使用されます。
Initialize the servlet mapping under which our controller servlet
is being accessed. This will be used in the &html:form>
tag to generate correct destination URLs for form submissions.
javax.servlet.ServletException - web.xmlを調べている間にエラーが発生した場合
protected void process(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException,
javax.servlet.ServletException
このリクエストに対する標準的なリクエスト処理を実行して、 対応するレスポンスを生成します。
Perform the standard request processing for this request, and create the corresponding response.
response - 生成するサーブレットレスポンス
java.io.IOException - 入出力エラーが生じた場合
javax.servlet.ServletException - サーブレット例外が生じた場合
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||