public abstract class AbstractPopulateActionForm extends ActionCommandBase
Populate the form bean (if any) for this request.
Constructor and Description |
---|
AbstractPopulateActionForm() |
Modifier and Type | Method and Description |
---|---|
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 void |
populate(ActionContext context,
ActionConfig actionConfig,
ActionForm actionForm)
Populate the given
ActionForm with request parameter
values, taking into account any prefix/suffix values configured on the
given ActionConfig . |
protected abstract void |
reset(ActionContext context,
ActionConfig actionConfig,
ActionForm actionForm)
Call the
reset() method on the specified form
bean. |
protected java.lang.String |
trimParameterName(ActionConfig actionConfig,
java.lang.String name)
For a given request parameter name, trim off any prefix and/or
suffix which are defined in
actionConfig and return what
remains. |
execute
public boolean execute(ActionContext actionCtx) throws java.lang.Exception
Populate the form bean (if any) for this request.
execute
in interface ActionCommand
execute
in class ActionCommandBase
actionCtx
- The Context
for the current requestfalse
so that processing continuesjava.lang.Exception
- On an unexpected errorprotected abstract void reset(ActionContext context, ActionConfig actionConfig, ActionForm actionForm)
Call the reset()
method on the specified form
bean.
context
- The context for this requestactionConfig
- The actionConfig for this requestactionForm
- The form bean for this requestprotected abstract void populate(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) throws java.lang.Exception
Populate the given ActionForm
with request parameter
values, taking into account any prefix/suffix values configured on the
given ActionConfig
.
context
- The ActionContext we are processingactionConfig
- The ActionConfig we are processingactionForm
- The ActionForm we are processingjava.lang.Exception
- On an unexpected errorprotected java.lang.String trimParameterName(ActionConfig actionConfig, java.lang.String name)
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 for
name
values which do not begin or end accordingly.
actionConfig
- The ActionConfig we are processingname
- The request parameter name to proceessprotected void handleCancel(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) throws java.lang.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.
context
- The ActionContext we are processingactionConfig
- The ActionConfig we are processingactionForm
- The ActionForm we are processingjava.lang.Exception
- On an unexpected errorGlobals.CANCEL_PROPERTY
,
Globals.CANCEL_PROPERTY_X
Copyright © 2000–2023 Apache Software Foundation. All rights reserved.