org.codecluster.struts12
クラス C2DispatchAction

java.lang.Object
  上位を拡張 org.apache.struts.action.Action
      上位を拡張 org.apache.struts.actions.DispatchAction
          上位を拡張 org.codecluster.struts12.C2DispatchAction

public class C2DispatchAction
extends org.apache.struts.actions.DispatchAction

Struts 1.2 の DispatchAction を拡張した Action クラスです。

アノテーションで実行メソッドを指定することができるように拡張したクラスです。


フィールドの概要
 
クラス org.apache.struts.actions.DispatchAction から継承されたフィールド
clazz, log, messages, methods, types
 
クラス org.apache.struts.action.Action から継承されたフィールド
defaultLocale, servlet
 
コンストラクタの概要
C2DispatchAction()
           
 
メソッドの概要
 org.apache.struts.action.ActionForward defaultAction(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          実行すべき Action が見つからない場合のデフォルト処理です。
protected  org.apache.struts.action.ActionForward dispatchMethod(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String name)
           
protected  java.lang.String getMethodName(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String parameter)
          Action アノテーションをチェックして実行すべきメソッド名を返します。
protected  java.lang.String getParameter(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
static javax.servlet.http.HttpServletRequest getRequest()
          本スレッドで実行中の HttpServletRequest を取得する
static javax.servlet.http.HttpServletResponse getResponse()
          本スレッドで実行中の HttpServletResponse を取得する
protected  org.apache.struts.action.ActionForward postDispatch(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String name)
          Action 処理の呼び出し後に実行される処理を記述します。
protected  org.apache.struts.action.ActionForward preDispatch(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String name)
          Action 処理の呼び出し前に実行される処理を記述します。
 
クラス org.apache.struts.actions.DispatchAction から継承されたメソッド
cancelled, execute, getMethod, unspecified
 
クラス org.apache.struts.action.Action から継承されたメソッド
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

C2DispatchAction

public C2DispatchAction()
メソッドの詳細

getRequest

public static javax.servlet.http.HttpServletRequest getRequest()
本スレッドで実行中の HttpServletRequest を取得する

戻り値:
HttpServletRequest

getResponse

public static javax.servlet.http.HttpServletResponse getResponse()
本スレッドで実行中の HttpServletResponse を取得する

戻り値:
HttpServletResponse

dispatchMethod

protected org.apache.struts.action.ActionForward dispatchMethod(org.apache.struts.action.ActionMapping mapping,
                                                                org.apache.struts.action.ActionForm form,
                                                                javax.servlet.http.HttpServletRequest request,
                                                                javax.servlet.http.HttpServletResponse response,
                                                                java.lang.String name)
                                                         throws java.lang.Exception
オーバーライド:
クラス org.apache.struts.actions.DispatchAction 内の dispatchMethod
例外:
java.lang.Exception

getMethodName

protected java.lang.String getMethodName(org.apache.struts.action.ActionMapping mapping,
                                         org.apache.struts.action.ActionForm form,
                                         javax.servlet.http.HttpServletRequest request,
                                         javax.servlet.http.HttpServletResponse response,
                                         java.lang.String parameter)
                                  throws java.lang.Exception
Action アノテーションをチェックして実行すべきメソッド名を返します。

Action アノテーションで指定されたパラメータ名がリクエスト内にある場合、 該当メソッドを実行対象としますので、同一フォーム内の複数 submit ボタンの振り分けに利用できます。

アノテーションとリクエスト内のパラメータが複数組マッチする場合の実行メソッドは未定義です。 そのようなフォームは作らないでください。

実行すべきメソッドが見つからない場合には defaultAction() が実行され、 デフォルトの実装は、"init" にフォワードするよう記述されています。

オーバーライド:
クラス org.apache.struts.actions.DispatchAction 内の getMethodName
例外:
java.lang.Exception
関連項目:
DispatchAction.getMethodName(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String)

getParameter

protected java.lang.String getParameter(org.apache.struts.action.ActionMapping mapping,
                                        org.apache.struts.action.ActionForm form,
                                        javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response)
                                 throws java.lang.Exception
オーバーライド:
クラス org.apache.struts.actions.DispatchAction 内の getParameter
例外:
java.lang.Exception

preDispatch

protected org.apache.struts.action.ActionForward preDispatch(org.apache.struts.action.ActionMapping mapping,
                                                             org.apache.struts.action.ActionForm form,
                                                             javax.servlet.http.HttpServletRequest request,
                                                             javax.servlet.http.HttpServletResponse response,
                                                             java.lang.String name)
                                                      throws java.lang.Exception
Action 処理の呼び出し前に実行される処理を記述します。

デフォルトでは何も処理しません。オーバーライドして記述してください。
戻り値に null 以外の ActionForward を返すと Action を呼び出さずに ActionForward に従った処理に移ります。

戻り値:
ActionForward
例外:
java.lang.Exception
関連項目:
DispatchAction.dispatchMethod(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String)

postDispatch

protected org.apache.struts.action.ActionForward postDispatch(org.apache.struts.action.ActionMapping mapping,
                                                              org.apache.struts.action.ActionForm form,
                                                              javax.servlet.http.HttpServletRequest request,
                                                              javax.servlet.http.HttpServletResponse response,
                                                              java.lang.String name)
                                                       throws java.lang.Exception
Action 処理の呼び出し後に実行される処理を記述します。

デフォルトでは何も処理しません。オーバーライドして記述してください。
戻り値に null 以外の ActionForward を返すと Action の結果を無視して本メソッドで指定した ActionForward に従った処理に移ります。

戻り値:
ActionForward
例外:
java.lang.Exception
関連項目:
DispatchAction.dispatchMethod(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String)

defaultAction

public org.apache.struts.action.ActionForward defaultAction(org.apache.struts.action.ActionMapping mapping,
                                                            org.apache.struts.action.ActionForm form,
                                                            javax.servlet.http.HttpServletRequest request,
                                                            javax.servlet.http.HttpServletResponse response)
                                                     throws java.lang.Exception
実行すべき Action が見つからない場合のデフォルト処理です。

mapping.findForward("init") を返却します。

戻り値:
mapping.findForward("init") を返却します。
例外:
java.lang.Exception