org.apache.struts.action
クラス ExceptionHandler

java.lang.Object
  拡張org.apache.struts.action.ExceptionHandler

public class ExceptionHandler
extends java.lang.Object

Action.executeメソッドによってスローされた例外の特定のタイプを扱うために、 ExceptionHandlerはStruts設定ファイル中で設定されます。

An ExceptionHandler is configured in the Struts configuration file to handle a specific type of exception thrown by an Action.execute method.

導入されたバージョン:
Struts 1.1
翻訳者:
棚澤 昌幸
翻訳状況:
初稿(校正者募集中)

フィールドの概要
private static org.apache.commons.logging.Log log
          Commons loggingのインスタンス。
private static MessageResources messages
          このパッケージのメッセージリソース。
 
コンストラクタの概要
ExceptionHandler()
           
 
メソッドの概要
 ActionForward execute(java.lang.Exception ex, ExceptionConfig ae, ActionMapping mapping, ActionForm formInstance, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Exceptionを取り扱います。
protected  void logException(java.lang.Exception e)
          commons-loggingを使用してExceptionを記録します。
protected  void storeException(javax.servlet.http.HttpServletRequest request, java.lang.String property, ActionError error, ActionForward forward, java.lang.String scope)
          推奨されていません。 storeException(HttpServletRequest, String, ActionMessage, ActionForward, String)を代わりに使用してください。 このメソッドは Struts 1.2 より後で削除される予定です。
@deprecated Use storeException(HttpServletRequest, String, ActionMessage, ActionForward, String) instead. This will be removed after Struts 1.2.
protected  void storeException(javax.servlet.http.HttpServletRequest request, java.lang.String property, ActionMessage error, ActionForward forward, java.lang.String scope)
          Actionを委譲している間、 Exceptionから発生したActionErrorを取り扱うためのデフォルト実装です。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

log

private static final org.apache.commons.logging.Log log

Commons loggingのインスタンス。

Commons logging instance.


messages

private static MessageResources messages

このパッケージのメッセージリソース。

The message resources for this package.

コンストラクタの詳細

ExceptionHandler

public ExceptionHandler()
メソッドの詳細

execute

public ActionForward execute(java.lang.Exception ex,
                             ExceptionConfig ae,
                             ActionMapping mapping,
                             ActionForm formInstance,
                             javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
                      throws javax.servlet.ServletException

Exceptionを取り扱います。 (もしあれば) 呼ばれたExceptionHandlerによって返されるActionForwardインスタンスを返します。

Handle the Exception. Return the ActionForward instance (if any) returned by the called ExceptionHandler.

パラメータ:
ex - 扱う例外
@param ex The exception to handle
ae - 例外に対応するExceptionConfig
@param ae The ExceptionConfig corresponding to the exception
mapping - 処理するActionMapping
@param mapping The ActionMapping we are processing
formInstance - 処理するActionForm
@param formInstance The ActionForm we are processing
request - 処理するサーブレットへのリクエスト
@param request The servlet request we are processing
response - 生成するサーブレットのレスポンス
@param response The servlet response we are creating
例外:
javax.servlet.ServletException - サーブレットで例外が発生した場合
@exception ServletException if a servlet exception occurs
導入されたバージョン:
Struts 1.1

logException

protected void logException(java.lang.Exception e)

commons-loggingを使用してExceptionを記録します。

Logs the Exception using commons-logging.

パラメータ:
e - 記録する例外
@param e The Exception to log.
導入されたバージョン:
Struts 1.2

storeException

protected void storeException(javax.servlet.http.HttpServletRequest request,
                              java.lang.String property,
                              ActionError error,
                              ActionForward forward,
                              java.lang.String scope)
推奨されていません。 storeException(HttpServletRequest, String, ActionMessage, ActionForward, String)を代わりに使用してください。 このメソッドは Struts 1.2 より後で削除される予定です。
@deprecated Use storeException(HttpServletRequest, String, ActionMessage, ActionForward, String) instead. This will be removed after Struts 1.2.

Actionを委譲している間、 Exceptionから発生したActionErrorを取り扱うためのデフォルト実装です。 用意されたスコープ(例外をマップするスコープ)により定義されたスコープとして、 デフォルト実装はリクエストまたはセッションの属性を設定します。 ActionErrorsのインスタンスが生成され、 エラーがコレクションに追加されます。 そのコレクションはGlobals.ERROR_KEY中のセットです。

Default implementation for handling an ActionError generated from an Exception during Action delegation. The default implementation is to set an attribute of the request or session, as defined by the scope provided (the scope from the exception mapping). An ActionErrors instance is created, the error is added to the collection and the collection is set under the Globals.ERROR_KEY.

パラメータ:
request - 扱うリクエスト
@param request The request we are handling
property - このエラーに使用するプロパティの名前
@param property The property name to use for this error
error - 例外マップから生成されたエラー
@param error The error generated from the exception mapping
forward - 入力パスから生成されたフォワード (フォームまたは例外マップが入力パスとなります。)
@param forward The forward generated from the input path (from the form or exception mapping)
scope - 例外マップのスコープ
@param scope The scope of the exception mapping.

storeException

protected void storeException(javax.servlet.http.HttpServletRequest request,
                              java.lang.String property,
                              ActionMessage error,
                              ActionForward forward,
                              java.lang.String scope)

Actionを委譲している間、 Exceptionから発生したActionErrorを取り扱うためのデフォルト実装です。 用意されたスコープ(例外マップのスコープ)により定義されたスコープとして、 デフォルト実装はリクエストまたはセッションの属性を設定します。 ActionErrorsのインスタンスが生成され、 エラーがコレクションに追加されます。 そのコレクションはGlobals.ERROR_KEY中のセットです。

Default implementation for handling an ActionMessage generated from an Exception during Action delegation. The default implementation is to set an attribute of the request or session, as defined by the scope provided (the scope from the exception mapping). An ActionMessages instance is created, the error is added to the collection and the collection is set under the Globals.ERROR_KEY.

パラメータ:
request - 扱うリクエスト
@param request The request we are handling
property - このエラーに使用するプロパティの名前
@param property The property name to use for this error
error - 例外マップから生成されたエラー
@param error The error generated from the exception mapping
forward - 入力パスから生成されたフォワード (フォームまたは例外マップが入力パスとなります。)
@param forward The forward generated from the input path (from the form or exception mapping)
scope - 例外マップのスコープ
@param scope The scope of the exception mapping.
導入されたバージョン:
Struts 1.2


このドキュメントは、Ja-Jakartaにより訳されました。コメントがある場合は、report@jajakarta.orgまでお願いします。
Copyright (C) 2000-2004 - Apache Software Foundation