|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.chain.commands.ActionCommandBase org.apache.struts.chain.commands.generic.CopyFormToContext
public class CopyFormToContext
Subclass this command and configure it as part of a per-forward chain to perform any necessary pre-population or other preparation for a form before control is dispatched to the view layer.
Field Summary |
---|
Fields inherited from interface org.apache.commons.chain.Command |
---|
CONTINUE_PROCESSING, PROCESSING_COMPLETE |
Constructor Summary | |
---|---|
CopyFormToContext()
|
Method Summary | |
---|---|
boolean |
execute(ActionContext actionContext)
Look up an ActionForm instance based on the configured properties of this command and copy it into the Context . |
protected ActionForm |
findOrCreateForm(ActionContext context)
Based on the properties of this command and the given ActionContext , find or create an ActionForm instance for
preparation. |
protected ActionForm |
findOrCreateForm(ActionContext ctx,
String effectiveFormName,
String effectiveScope)
Actually find or create an instance of ActionForm configured under the form-bean-name effectiveFormName , looking in in the
ActionContext's scope as identified by
effectiveScope . |
String |
getActionPath()
Return ActionPath property. |
String |
getFormName()
Return FormName property. |
String |
getScope()
Return Scope property. |
String |
getToKey()
Return ToKey property. |
void |
setActionPath(String actionPath)
Set ActionPath property. |
void |
setFormName(String formName)
Set FormName property. |
void |
setScope(String scope)
Set Scope property. |
void |
setToKey(String toKey)
Set ToKey property. |
Methods inherited from class org.apache.struts.chain.commands.ActionCommandBase |
---|
execute |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CopyFormToContext()
Method Detail |
---|
public String getActionPath()
Return ActionPath property.
public void setActionPath(String actionPath)
Set ActionPath property.
actionPath
- New valuefor ActionPathpublic String getFormName()
Return FormName property.
public void setFormName(String formName)
Set FormName property.
formName
- New valuefor FormNamepublic String getScope()
Return Scope property.
public void setScope(String scope)
Set Scope property.
scope
- New valuefor Scopepublic String getToKey()
Return ToKey property.
public void setToKey(String toKey)
Set ToKey property.
toKey
- New valuefor FormNamepublic boolean execute(ActionContext actionContext) throws Exception
Look up an ActionForm instance based on the configured properties of
this command and copy it into the Context
. After this
command successfully executes, an ActionForm instance will exist in the
specified scope and will be available, for example for backing fields
in an HTML form. It will also be in the ActionContext
available for another command to do prepopulation of values or other
preparation.
execute
in interface ActionCommand
execute
in class ActionCommandBase
actionContext
- Our ActionContext
Exception
- on any errorprotected ActionForm findOrCreateForm(ActionContext context) throws IllegalAccessException, InstantiationException
Based on the properties of this command and the given
ActionContext
, find or create an ActionForm instance for
preparation.
context
- ActionContextBase class that we are processing
IllegalArgumentException
- On ActionConfig not found
IllegalStateException
- On undefined scope and formbean
IllegalAccessException
- On failed instantiation
InstantiationException
- If ActionContext is not subsclass of
ActionContextBaseprotected ActionForm findOrCreateForm(ActionContext ctx, String effectiveFormName, String effectiveScope) throws IllegalAccessException, InstantiationException
Actually find or create an instance of ActionForm configured under
the form-bean-name effectiveFormName
, looking in in the
ActionContext's
scope as identified by
effectiveScope
. If a form is created, it will also be
stored in that scope.
NOTE: This specific method depends on the instance of
ActionContext
which is passed being a subclass of
ActionContextBase
, which implements the utility method
findOrCreateActionForm
.
ctx
- The ActionContext we are processingeffectiveFormName
- the target form nameeffectiveScope
- The target scope
InstantiationException
- If ActionContext is not subsclass of
ActionContextBase
InstantiationException
- If object cannot be created
IllegalArgumentException
- On form not found in/ scope
IllegalAccessException
- On failed instantiation
IllegalStateException
- If ActionContext is not a subclass of
ActionBase
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |