jp.terasoluna.fw.web.struts.actions
Class ReloadCodeListAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by jp.terasoluna.fw.web.struts.actions.ActionEx
          extended by jp.terasoluna.fw.web.struts.actions.ReloadCodeListAction

public class ReloadCodeListAction
extends ActionEx

Action that reloads the cached codelist.

When ReloadableCodeListLoader that performs the reload process, is set by using setCodeListLoader method and this action is executed, reload() method of that ReloadableCodeListLoader is invoked and code list is reloaded. When the reloading of code list is complete, this action forwards to the destination specified in the "parameter" attribute of the action property in Struts configuration file (struts-config.xml). When the forward destination is not set, returns the error SC_NOT_FOUND(404).

Configuration example of Bean definition file.
In the following example, "loader1" is defined as ReloadableCodeListLoader.
 <bean name="/reloadAction" scope="prototype"
       class = "jp.terasoluna.fw.web.struts.actions.ReloadCodeListAction">
   <property name="codeListLoader">
     <ref bean="loader1"/>
   </property>
 </bean>
 
Configuration example of Struts configuration file (struts-config.xml)
  <action path="/reloadAction"
          name="_sampleFormBean"
          parameter = "/reloaded.do"/>
 

There is no function which can regenerate ReloadableCodeListLoader. Therefore, it is not possible to change or modify the SQL statements in the ReloadableCodeListLoader.
To generate the reloadable code list, refer to ReloadableCodeListLoader.
For the usage method of code list in JSP, refer to DefineCodeListTag, DefineCodeListCountTag.

See Also:
ReloadableCodeListLoader, DBCodeListLoader, DefineCodeListTag, WriteCodeCountTag

Field Summary
private  ReloadableCodeListLoader codeListLoader
          ReloadableCodeListLoader used for reloading.
private static java.lang.String FORWARD_ERRORPAGE_ERROR
          Error page (404) It is an error code indicating the forward failure.
private static org.apache.commons.logging.Log log
          Log class.
 
Fields inherited from class jp.terasoluna.fw.web.struts.actions.ActionEx
FORWARD_TXTOKEN_ERROR
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
ReloadCodeListAction()
           
 
Method Summary
 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)
          Reloads cached code list.
 ReloadableCodeListLoader getCodeListLoader()
          Fetches codeListLoader.
 void setCodeListLoader(ReloadableCodeListLoader codeListLoader)
          Sets codeListLoader.
 
Methods inherited from class jp.terasoluna.fw.web.struts.actions.ActionEx
addErrors, addMessages, execute, isSaveToken, isTokenCheck, processTokenCheck, setSaveToken, setTokenCheck
 
Methods inherited from class 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

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


FORWARD_ERRORPAGE_ERROR

private static final java.lang.String FORWARD_ERRORPAGE_ERROR
Error page(404) It is a error code indicating forward failure.

See Also:
Constant Field Values

codeListLoader

private ReloadableCodeListLoader codeListLoader
ReloadableCodeListLoader used for reloading.

Constructor Detail

ReloadCodeListAction

public ReloadCodeListAction()
Method Detail

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)
Reloads the cached code list.

After executing this process, this action forwards to the destination specified in "parameter" attribute. When "parameter" attribute is not set or codeListLoader does not exist, returns the error (404)SC_NOT_FOUND.

Specified by:
doExecute in class ActionEx
Parameters:
mapping - Action mapping
form - Action form
req - HTTP request
res - HTTP response
Returns:
Foreward path specified in "parameter"attribute

getCodeListLoader

public ReloadableCodeListLoader getCodeListLoader()
Fetches codeListLoader.

Returns:
Field value indicating codeListLoader.

setCodeListLoader

public void setCodeListLoader(ReloadableCodeListLoader codeListLoader)
Sets codeListLoader.

Parameters:
codeListLoader - Field value indicating codeListLoader.