|
||||||||||
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,
java.lang.String effectiveFormName,
java.lang.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 . |
java.lang.String |
getActionPath()
Return ActionPath property. |
java.lang.String |
getFormName()
Return FormName property. |
java.lang.String |
getScope()
Return Scope property. |
java.lang.String |
getToKey()
Return ToKey property. |
void |
setActionPath(java.lang.String actionPath)
Set ActionPath property. |
void |
setFormName(java.lang.String formName)
Set FormName property. |
void |
setScope(java.lang.String scope)
Set Scope property. |
void |
setToKey(java.lang.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 java.lang.String getActionPath()
Return ActionPath property.
public void setActionPath(java.lang.String actionPath)
Set ActionPath property.
actionPath
- New valuefor ActionPathpublic java.lang.String getFormName()
Return FormName property.
public void setFormName(java.lang.String formName)
Set FormName property.
formName
- New valuefor FormNamepublic java.lang.String getScope()
Return Scope property.
public void setScope(java.lang.String scope)
Set Scope property.
scope
- New valuefor Scopepublic java.lang.String getToKey()
Return ToKey property.
public void setToKey(java.lang.String toKey)
Set ToKey property.
toKey
- New valuefor FormNamepublic boolean execute(ActionContext actionContext) throws java.lang.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
java.lang.Exception
- on any errorprotected ActionForm findOrCreateForm(ActionContext context) throws java.lang.IllegalAccessException, java.lang.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
java.lang.IllegalArgumentException
- On ActionConfig not found
java.lang.IllegalStateException
- On undefined scope and formbean
java.lang.IllegalAccessException
- On failed instantiation
java.lang.InstantiationException
- If ActionContext is not subsclass of
ActionContextBaseprotected ActionForm findOrCreateForm(ActionContext ctx, java.lang.String effectiveFormName, java.lang.String effectiveScope) throws java.lang.IllegalAccessException, java.lang.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
java.lang.InstantiationException
- If ActionContext is not subsclass of
ActionContextBase
java.lang.InstantiationException
- If object cannot be created
java.lang.IllegalArgumentException
- On form not found in/ scope
java.lang.IllegalAccessException
- On failed instantiation
java.lang.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 |