org.apache.struts.chain
Class AbstractPopulateActionForm

java.lang.Object
  extended byorg.apache.struts.chain.AbstractPopulateActionForm
All Implemented Interfaces:
org.apache.commons.chain.Command
Direct Known Subclasses:
PopulateActionForm

public abstract class AbstractPopulateActionForm
extends java.lang.Object
implements org.apache.commons.chain.Command

Populate the form bean (if any) for this request.

Version:
$Rev: 55324 $ $Date: 2004-10-22 19:55:27 +0100 (Fri, 22 Oct 2004) $
Author:
Craig R. McClanahan

Field Summary
private  java.lang.String actionConfigKey
           
private  java.lang.String actionFormKey
           
private  java.lang.String cancelKey
           
 
Constructor Summary
AbstractPopulateActionForm()
           
 
Method Summary
 boolean execute(org.apache.commons.chain.Context context)
          Populate the form bean (if any) for this request.
 java.lang.String getActionConfigKey()
          Return the context attribute key under which the ActionConfig for the currently selected application action is stored.
 java.lang.String getActionFormKey()
          Return the context attribute key under which the ActionForm for the currently selected application action is stored.
 java.lang.String getCancelKey()
          Return the context attribute key under which the cancellation flag for this request is stored.
protected  void handleCancel(org.apache.commons.chain.Context context, org.apache.struts.config.ActionConfig actionConfig, org.apache.struts.action.ActionForm actionForm)
           
protected  void populate(org.apache.commons.chain.Context context, org.apache.struts.config.ActionConfig actionConfig, org.apache.struts.action.ActionForm actionForm)
          Base implementation assumes that the Context can be cast to WebContext and copies the parameter values from the context to the ActionForm.
protected abstract  void reset(org.apache.commons.chain.Context context, org.apache.struts.config.ActionConfig actionConfig, org.apache.struts.action.ActionForm actionForm)
          Call the reset() method on the specified form bean.
 void setActionConfigKey(java.lang.String actionConfigKey)
          Set the context attribute key under which the ActionConfig for the currently selected application action is stored.
 void setActionFormKey(java.lang.String actionFormKey)
          Set the context attribute key under which the ActionForm for the currently selected application action is stored.
 void setCancelKey(java.lang.String cancelKey)
          Set the context attribute key under which the cancellation flag for this request is stored.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actionConfigKey

private java.lang.String actionConfigKey

actionFormKey

private java.lang.String actionFormKey

cancelKey

private java.lang.String cancelKey
Constructor Detail

AbstractPopulateActionForm

public AbstractPopulateActionForm()
Method Detail

getActionConfigKey

public java.lang.String getActionConfigKey()

Return the context attribute key under which the ActionConfig for the currently selected application action is stored.


setActionConfigKey

public void setActionConfigKey(java.lang.String actionConfigKey)

Set the context attribute key under which the ActionConfig for the currently selected application action is stored.

Parameters:
actionConfigKey - The new context attribute key

getActionFormKey

public java.lang.String getActionFormKey()

Return the context attribute key under which the ActionForm for the currently selected application action is stored.


setActionFormKey

public void setActionFormKey(java.lang.String actionFormKey)

Set the context attribute key under which the ActionForm for the currently selected application action is stored.

Parameters:
actionFormKey - The new context attribute key

getCancelKey

public java.lang.String getCancelKey()

Return the context attribute key under which the cancellation flag for this request is stored.


setCancelKey

public void setCancelKey(java.lang.String cancelKey)

Set the context attribute key under which the cancellation flag for this request is stored.

Parameters:
cancelKey - The new context attribute key

execute

public boolean execute(org.apache.commons.chain.Context context)
                throws java.lang.Exception

Populate the form bean (if any) for this request.

Specified by:
execute in interface org.apache.commons.chain.Command
Parameters:
context - The Context for the current request
Returns:
false so that processing continues
Throws:
java.lang.Exception

reset

protected abstract void reset(org.apache.commons.chain.Context context,
                              org.apache.struts.config.ActionConfig actionConfig,
                              org.apache.struts.action.ActionForm actionForm)

Call the reset() method on the specified form bean.

Parameters:
context - The context for this reqest
actionConfig - The actionConfig for this request
actionForm - The form bean for this request

populate

protected void populate(org.apache.commons.chain.Context context,
                        org.apache.struts.config.ActionConfig actionConfig,
                        org.apache.struts.action.ActionForm actionForm)
                 throws java.lang.Exception

Base implementation assumes that the Context can be cast to WebContext and copies the parameter values from the context to the ActionForm.

Note that this implementation does not handle "file uploads" because as far as I know there is no API for handling that without committing to servlets -- in a servlet environment, use org.apache.struts.chain.servlet.PopulateActionForm.

Parameters:
context -
actionConfig -
actionForm -
Throws:
java.lang.Exception

handleCancel

protected void handleCancel(org.apache.commons.chain.Context context,
                            org.apache.struts.config.ActionConfig actionConfig,
                            org.apache.struts.action.ActionForm actionForm)
                     throws java.lang.Exception
Throws:
java.lang.Exception


Copyright ? 2003 - Apache Software Foundation