org.apache.struts.chain.legacy
Class ChainAction

java.lang.Object
  extended byorg.apache.struts.action.Action
      extended byorg.apache.struts.chain.legacy.ChainAction

public class ChainAction
extends org.apache.struts.action.Action

An Action implementation that delegates to a configured Chain (or Command) for performing the actual business logic related to a request. The name of the chain to be executed is specified by setting the parameter attribute of the <action> element configuring this action. For example:

   <action path="/myaction"
           type="org.apache.struts.chain.legacy.ChainAction"
           name="myform"
          scope="request"
          input="/mypage.jsp"
      parameter="name-of-chain-to-execute"
 

Prior to calling the specified chain (or command), this action sets up a Context object containing the relevant properties, along with the following additional attributes:

After execution of the specified command or chain is completed, the following context attributes are examined (in this order) to determine how to proceed.


Field Summary
private  org.apache.commons.chain.Catalog catalog
          The Catalog that will be consulted to look up the Command to be executed.
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
ChainAction()
           
 
Method Summary
 org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Delegate to the command chain specified in our configuration.
protected  org.apache.commons.chain.Catalog getCatalog()
          Return the Catalog we will use to acquire the Command to be executed.
 
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

catalog

private org.apache.commons.chain.Catalog catalog

The Catalog that will be consulted to look up the Command to be executed.

Constructor Detail

ChainAction

public ChainAction()
Method Detail

execute

public org.apache.struts.action.ActionForward execute(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

Delegate to the command chain specified in our configuration.

Parameters:
mapping - ActionMapping configuring this action
form - ActionForm for this request (if any)
request - HttpServletRequest we are processing
response - HttpServletResponse we are creating
Throws:
java.lang.Exception

getCatalog

protected org.apache.commons.chain.Catalog getCatalog()

Return the Catalog we will use to acquire the Command to be executed. NOTE: Any race condition calling this method is harmless, so do not bother to synchronize.



Copyright ? 2003 - Apache Software Foundation