org.apache.struts.chain
Class AbstractValidateActionForm

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

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

Validate the properties of the form bean for this request. If there are any validation errors, execute the specified command; otherwise, proceed normally.

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
           
private static org.apache.commons.logging.Log log
           
private  java.lang.String validKey
           
 
Constructor Summary
AbstractValidateActionForm()
           
 
Method Summary
 boolean execute(org.apache.commons.chain.Context context)
          Validate the properties of the form bean 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.
 java.lang.String getValidKey()
          Return the context attribute key under which the validity flag for this request is stored.
 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.
 void setValidKey(java.lang.String validKey)
          Set the context attribute key under which the validity flag for this request is stored.
protected abstract  org.apache.struts.action.ActionErrors validate(org.apache.commons.chain.Context context, org.apache.struts.config.ActionConfig actionConfig, org.apache.struts.action.ActionForm actionForm)
          Call the validate() method of the specified form bean, and return the resulting ActionErrors object.
 
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

validKey

private java.lang.String validKey

log

private static final org.apache.commons.logging.Log log
Constructor Detail

AbstractValidateActionForm

public AbstractValidateActionForm()
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

getValidKey

public java.lang.String getValidKey()

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


setValidKey

public void setValidKey(java.lang.String validKey)

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

Parameters:
validKey - The new context attribute key

execute

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

Validate the properties of the form bean for this request. If there are any validation errors, execute the child commands in our chain; otherwise, proceed normally.

Specified by:
execute in interface org.apache.commons.chain.Command
Parameters:
context - The Context for the current request
Returns:
false so that processing continues, if there are no validation errors; otherwise true
Throws:
java.lang.Exception

validate

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

Call the validate() method of the specified form bean, and return the resulting ActionErrors object.

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


Copyright ? 2003 - Apache Software Foundation