Class AbstractPopulateActionForm
- All Implemented Interfaces:
org.apache.commons.chain.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
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
execute_
(ActionContext actionCtx) Populate the form bean (if any) for this request.protected void
handleCancel
(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) Take into account whether the request includes any defined value for the global "cancel" parameter.protected abstract boolean
isPopulate
(ActionContext context, ActionConfig actionConfig) Determines whether an action form should be populated.protected abstract boolean
isReset
(ActionContext context, ActionConfig actionConfig) Determines whether an action form should be resetprotected abstract void
populate
(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) Populate the givenActionForm
with request parameter values, taking into account any prefix/suffix values configured on the givenActionConfig
.protected abstract void
reset
(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) Call thereset()
method on the specified form bean.protected String
trimParameterName
(ActionConfig actionConfig, String name) For a given request parameter name, trim off any prefix and/or suffix which are defined inactionConfig
and 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
- TheContext
for the current request- Returns:
false
so 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
ActionForm
with 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
actionConfig
and return what remains. If either prefix or suffix is defined, then return null forname
values 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:
-