Class AbstractPopulateActionForm
- All Implemented Interfaces:
Command<ActionContext>,ActionCommand
- Direct Known Subclasses:
PopulateActionForm
Populate the form bean (if any) for this request.
- Version:
- $Rev$ $Date: 2005-11-12 13:01:44 -0500 (Sat, 12 Nov 2005) $
-
Field Summary
Fields inherited from interface org.apache.commons.chain.Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanexecute_(ActionContext actionCtx) Populate the form bean (if any) for this request.protected voidhandleCancel(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) Take into account whether the request includes any defined value for the global "cancel" parameter.protected abstract booleanisPopulate(ActionContext context, ActionConfig actionConfig) Determines whether an action form should be populated.protected abstract booleanisReset(ActionContext context, ActionConfig actionConfig) Determines whether an action form should be resetprotected abstract voidpopulate(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) Populate the givenActionFormwith request parameter values, taking into account any prefix/suffix values configured on the givenActionConfig.protected abstract voidreset(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) Call thereset()method on the specified form bean.protected StringtrimParameterName(ActionConfig actionConfig, String name) For a given request parameter name, trim off any prefix and/or suffix which are defined inactionConfigand return what remains.Methods inherited from class org.apache.struts.chain.commands.ActionCommandBase
execute
-
Constructor Details
-
AbstractPopulateActionForm
public AbstractPopulateActionForm()
-
-
Method Details
-
execute_
Populate the form bean (if any) for this request.
- Specified by:
execute_in classActionCommandBase- Parameters:
actionCtx- TheContextfor the current request- Returns:
falseso that processing continues- Throws:
Exception- On an unexpected error
-
isReset
Determines whether an action form should be reset- Parameters:
context- the ActionContext we are processingactionConfig- action config for current request- Returns:
- true if action form should be reset
- Since:
- Struts 1.4
-
isPopulate
Determines whether an action form should be populated.- Parameters:
context- the ActionContext we are processingactionConfig- action config for current request- Returns:
- true if action form should be populated
- Since:
- Struts 1.4
-
reset
protected abstract void reset(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) Call the
reset()method on the specified form bean.- Parameters:
context- The context for this requestactionConfig- The actionConfig for this requestactionForm- The form bean for this request
-
populate
protected abstract void populate(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) throws Exception Populate the given
ActionFormwith request parameter values, taking into account any prefix/suffix values configured on the givenActionConfig.- Parameters:
context- The ActionContext we are processingactionConfig- The ActionConfig we are processingactionForm- The ActionForm we are processing- Throws:
Exception- On an unexpected error
-
trimParameterName
For a given request parameter name, trim off any prefix and/or suffix which are defined in
actionConfigand return what remains. If either prefix or suffix is defined, then return null fornamevalues which do not begin or end accordingly.- Parameters:
actionConfig- The ActionConfig we are processingname- The request parameter name to proceess- Returns:
- The request parameter name trimmed of any suffix or prefix
-
handleCancel
protected void handleCancel(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) throws Exception Take into account whether the request includes any defined value for the global "cancel" parameter.
An issue was raised (but I don't think a Bugzilla ticket created) about the security implications of using a well-known cancel property which skips form validation, as you may not write your actions to deal with the cancellation case.
- Parameters:
context- The ActionContext we are processingactionConfig- The ActionConfig we are processingactionForm- The ActionForm we are processing- Throws:
Exception- On an unexpected error- See Also:
-