| org.springframework.webflow.executor.struts.FlowAction
FlowAction | public class FlowAction extends ActionSupport (Code) | | Point of integration between Struts and Spring Web Flow: a Struts Action that
acts a front controller entry point into the web flow system. A single
FlowAction may launch any new FlowExecution. In addition, a single Flow
Action may signal events in any existing/restored FlowExecutions.
Requests are managed by and delegated to a
FlowExecutor , which this
class delegates to using a
FlowRequestHandler (allowing reuse of
common front flow controller logic in other environments). Consult the
JavaDoc of those classes for more information on how requests are processed.
By default, to have this controller launch a new flow execution
(conversation), have the client send a
FlowExecutorArgumentHandler.getFlowIdArgumentName request
parameter indicating the flow definition to launch.
To have this controller participate in an existing flow execution
(conversation), have the client send a
FlowExecutorArgumentHandler.getFlowExecutionKeyArgumentName request parameter identifying the conversation to participate in.
On each request received by this action, a
StrutsExternalContext object is created as input to the web flow system. This external source event
provides access to the action form, action mapping, and other Struts-specific
constructs.
This class also is aware of the
SpringBindingActionForm adapter,
which adapts Spring's data binding infrastructure (based on POJO binding, a
standard Errors interface, and property editor type conversion) to the Struts
action form model. This option gives backend web-tier developers full support
for POJO-based binding with minimal hassel, while still providing consistency
to view developers who already have a lot of experience with Struts for
markup and request dispatching.
Below is an example struts-config.xml configuration for a
FlowAction:
<action path="/userRegistration"
type="org.springframework.webflow.executor.struts.FlowAction"
name="springBindingActionForm" scope="request">
</action>
This example maps the logical request URL /userRegistration.do
as a Flow controller (FlowAction ). It is expected that flows
to launch be provided in a dynamic fashion by the views (allowing this single
FlowAction to manage any number of flow executions). A Spring
binding action form instance is set in request scope, acting as an adapter
enabling POJO-based binding and validation with Spring.
Other notes regarding Struts/Spring Web Flow integration:
The benefits here are considerable: developers now have a powerful web flow
capability integrated with Struts, with a consistent-approach to POJO-based
binding and validation that addresses the proliferation of
ActionForm classes found in traditional Struts-based apps.
See Also: org.springframework.webflow.executor.FlowExecutor See Also: org.springframework.webflow.executor.support.FlowRequestHandler See Also: org.springframework.web.struts.SpringBindingActionForm See Also: org.springframework.web.struts.DelegatingActionProxy author: Keith Donald author: Erwin Vervaet |
Field Summary | |
final protected static String | FLOW_EXECUTOR_ARGUMENT_HANDLER_BEAN_NAME The flow executor argument handler will be retreived from the
application context using this bean name if no argument handler is
explicitly set. | final protected static String | FLOW_EXECUTOR_BEAN_NAME The flow executor will be retreived from the application context using
this bean name if no executor is explicitly set. |
Method Summary | |
protected ActionForward | createRedirectForward(String url, HttpServletResponse response) Handles a redirect. | protected FlowRequestHandler | createRequestHandler() Factory method that creates a new helper for processing a request into
this flow controller. | public ActionForward | execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) | protected ActionForward | findForward(ApplicationView forward, ActionMapping mapping) Find an action forward for given application view. | public FlowExecutorArgumentHandler | getArgumentHandler() Returns the flow executor argument handler used by this controller. | public FlowExecutor | getFlowExecutor() Returns the flow executor used by this controller. | protected void | onInit() | public void | setArgumentHandler(FlowExecutorArgumentHandler argumentHandler) Sets the flow executor argument handler to use. | public void | setFlowExecutor(FlowExecutor flowExecutor) Configures the flow executor implementation to use. | protected ActionForward | toActionForward(ResponseInstruction responseInstruction, ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, ExternalContext context) Return a Struts ActionForward given a ResponseInstruction. |
FLOW_EXECUTOR_ARGUMENT_HANDLER_BEAN_NAME | final protected static String FLOW_EXECUTOR_ARGUMENT_HANDLER_BEAN_NAME(Code) | | The flow executor argument handler will be retreived from the
application context using this bean name if no argument handler is
explicitly set. ("argumentHandler")
|
FLOW_EXECUTOR_BEAN_NAME | final protected static String FLOW_EXECUTOR_BEAN_NAME(Code) | | The flow executor will be retreived from the application context using
this bean name if no executor is explicitly set. ("flowExecutor")
|
createRequestHandler | protected FlowRequestHandler createRequestHandler()(Code) | | Factory method that creates a new helper for processing a request into
this flow controller.
the controller helper |
findForward | protected ActionForward findForward(ApplicationView forward, ActionMapping mapping)(Code) | | Find an action forward for given application view. If no suitable forward
is found in the action mapping using the view name as a key, this method
will create a new action forward using the view name.
Parameters: forward - the application view to find a forward for Parameters: mapping - the action mapping to use the action forward, never null |
getArgumentHandler | public FlowExecutorArgumentHandler getArgumentHandler()(Code) | | Returns the flow executor argument handler used by this controller.
the argument handler |
getFlowExecutor | public FlowExecutor getFlowExecutor()(Code) | | Returns the flow executor used by this controller.
the flow executor |
onInit | protected void onInit()(Code) | | |
setArgumentHandler | public void setArgumentHandler(FlowExecutorArgumentHandler argumentHandler)(Code) | | Sets the flow executor argument handler to use.
Parameters: argumentHandler - the fully configured argument handler |
setFlowExecutor | public void setFlowExecutor(FlowExecutor flowExecutor)(Code) | | Configures the flow executor implementation to use. Required.
Parameters: flowExecutor - the fully configured flow executor |
|
|