public class MultiAction extends AbstractAction
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"> <evaluate expression="searchAction.executeSearch"/> <transition on="success" to="results"/> </action-state>... when entered, executes the method:
public Event search(RequestContext context) throws Exception;
One use of the MultiAction is to centralize all command logic for a flow in one place. Another 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
Modifier and Type | Class and Description |
---|---|
static interface |
MultiAction.MethodResolver
Strategy interface used by the MultiAction to map a request context to the name of an action execution method.
|
Constructor and Description |
---|
MultiAction(Object target)
Constructs a multi action that invokes methods on the specified target object.
|
Modifier and Type | Method and Description |
---|---|
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.
|
afterPropertiesSet, execute, getEventFactorySupport
public MultiAction(Object target)
public Event ${method}(RequestContext context) throws Exception;
target
- the target of this multi action's invocationspublic MultiAction.MethodResolver getMethodResolver()
public void setMethodResolver(MultiAction.MethodResolver methodResolver)
DefaultMultiActionMethodResolver
.