|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.webflow.action.AbstractAction
org.springframework.webflow.action.MultiAction
public class MultiAction
Action implementation that bundles two or more action execution methods into a single class. Action execution methods defined by subclasses must adhere to the following signature:
public Event ${method}(RequestContext context) throws Exception;When this action is invoked, by default the
id
of the calling action state state is treated as the
action execution method name. Alternatively, the execution method name may be explicitly specified as a attribute of
the calling action state.
For example, the following action state definition:
<action-state id="search"> <action bean="searchAction"/> <transition on="success" to="results"/> </action-state>... when entered, executes the method:
public Event search(RequestContext context) throws Exception;Alternatively (and typically recommended), you may explictly specify the method name:
<action-state id="search"> <action bean="searchAction" method="executeSearch"/> <transition on="success" to="results"/> </action-state>
A typical use of the MultiAction is to centralize all command logic for a flow in one place. Another common use is to centralize form setup and submit logic in one place, or CRUD (create/read/update/delete) operations for a single domain object in one place.
MultiAction.MethodResolver
,
DefaultMultiActionMethodResolver
Nested Class Summary | |
---|---|
static interface |
MultiAction.MethodResolver
Strategy interface used by the MultiAction to map a request context to the name of an action execution method. |
Field Summary |
---|
Fields inherited from class org.springframework.webflow.action.AbstractAction |
---|
logger |
Constructor Summary | |
---|---|
protected |
MultiAction()
Protected default constructor; not invokable for direct MultiAction instantiation. |
|
MultiAction(java.lang.Object target)
Constructs a multi action that invokes methods on the specified target object. |
Method Summary | |
---|---|
protected Event |
doExecute(RequestContext context)
Template hook method subclasses should override to encapsulate their specific action execution logic. |
MultiAction.MethodResolver |
getMethodResolver()
Get the strategy used to resolve action execution method names. |
void |
setMethodResolver(MultiAction.MethodResolver methodResolver)
Set the strategy used to resolve action execution method names. |
protected void |
setTarget(java.lang.Object target)
Sets the target of this multi action's invocations. |
Methods inherited from class org.springframework.webflow.action.AbstractAction |
---|
afterPropertiesSet, doPostExecute, doPreExecute, error, error, execute, getActionNameForLogging, getEventFactorySupport, initAction, no, result, result, result, result, success, success, yes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected MultiAction()
Sets the target to this multi action instance.
setTarget(Object)
public MultiAction(java.lang.Object target)
public Event ${method}(RequestContext context) throws Exception;
target
- the target of this multi action's invocationsMethod Detail |
---|
protected final void setTarget(java.lang.Object target)
target
- the targetpublic MultiAction.MethodResolver getMethodResolver()
public void setMethodResolver(MultiAction.MethodResolver methodResolver)
DefaultMultiActionMethodResolver
.
protected final Event doExecute(RequestContext context) throws java.lang.Exception
AbstractAction
doExecute
in class AbstractAction
context
- the action execution context, for accessing and setting data in "flow scope" or "request scope"
java.lang.Exception
- an unrecoverable exception occured, either checked or unchecked
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |