jp.terasoluna.fw.web.struts.actions
クラス ReloadCodeListAction

java.lang.Object
  上位を拡張 org.apache.struts.action.Action
      上位を拡張 jp.terasoluna.fw.web.struts.actions.ActionEx
          上位を拡張 jp.terasoluna.fw.web.struts.actions.ReloadCodeListAction

public class ReloadCodeListAction
extends ActionEx

キャッシュされているコードリストを再読み込みするアクション。

再読み込みを行う ReloadableCodeListLoader を setCodeListLoaderメソッドで設定することによって、 このアクションが実行されるとそのReloadableCodeListLoader が持つ reload() メソッドを呼び出し、コードリストの再読み込みを行う。 コードリスト再読み込みを実行後、Struts設定ファイル(struts-config.xml) で action プロパティの parameter 属性に指定した先にフォワードする。 フォワード先が設定されていない場合、 SC_NOT_FOUND(404) エラーを返す。

Bean定義ファイルの設定例。
以下は ReloadableCodeListLoader として "loader1" が 定義してある場合の例である。
 <bean name="/reloadAction" scope="prototype"
       class = "jp.terasoluna.fw.web.struts.actions.ReloadCodeListAction">
   <property name="codeListLoader">
     <ref bean="loader1"/>
   </property>
 </bean>
 
Struts設定ファイル(struts-config.xml) 設定例
  <action path="/reloadAction"
          name="_sampleFormBean"
          parameter = "/reloaded.do"/>
 

ReloadableCodeListLoader そのものを再生成する機能ではないため、 その中身の SQL 文などを変更することは不可能である。
再読み込み可能なコードリストの生成については、 ReloadableCodeListLoader を参照。
またJSP内のコードリストの使用方法については、DefineCodeListTag、 DefineCodeListCountTag を参照。

関連項目:
ReloadableCodeListLoader, DBCodeListLoader, DefineCodeListTag, WriteCodeCountTag

フィールドの概要
 
クラス jp.terasoluna.fw.web.struts.actions.ActionEx から継承されたフィールド
FORWARD_TXTOKEN_ERROR
 
クラス org.apache.struts.action.Action から継承されたフィールド
defaultLocale, servlet
 
コンストラクタの概要
ReloadCodeListAction()
           
 
メソッドの概要
 org.apache.struts.action.ActionForward doExecute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          キャッシュされているコードリストを再読込みする。
 ReloadableCodeListLoader getCodeListLoader()
          codeListLoader を取得する。
 void setCodeListLoader(ReloadableCodeListLoader codeListLoader)
          codeListLoader を設定する。
 
クラス jp.terasoluna.fw.web.struts.actions.ActionEx から継承されたメソッド
addErrors, addMessages, execute, isSaveToken, isTokenCheck, processTokenCheck, setSaveToken, setTokenCheck
 
クラス 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
 

コンストラクタの詳細

ReloadCodeListAction

public ReloadCodeListAction()
メソッドの詳細

doExecute

public org.apache.struts.action.ActionForward doExecute(org.apache.struts.action.ActionMapping mapping,
                                                        org.apache.struts.action.ActionForm form,
                                                        javax.servlet.http.HttpServletRequest req,
                                                        javax.servlet.http.HttpServletResponse res)
キャッシュされているコードリストを再読込みする。

この処理実行後、常に parameter 属性に指定した先にフォワードする。 parameter 属性が指定されていなかったり、codeListLoaderが存在しない場合 SC_NOT_FOUND(404) エラーを返す。

定義:
クラス ActionEx 内の doExecute
パラメータ:
mapping - アクションマッピング
form - アクションフォーム
req - HTTPリクエスト
res - HTTPレスポンス
戻り値:
parameter 属性に指定した遷移先情報

getCodeListLoader

public ReloadableCodeListLoader getCodeListLoader()
codeListLoader を取得する。

戻り値:
codeListLoader を表すフィールド値。

setCodeListLoader

public void setCodeListLoader(ReloadableCodeListLoader codeListLoader)
codeListLoader を設定する。

パラメータ:
codeListLoader - codeListLoader を表すフィールド値。


Copyright © 2012. All Rights Reserved.