Apache Struts 2 Plugin Registry > Home > Spring Webflow Plugin |
Name | Spring Webflow Plugin |
---|---|
Publisher | Tom Schneider |
License | Open Source (ASL2) |
Version | 1.0.3 Production |
Compatibility | Struts 2.0.6+ |
Homepage | http://code.google.com/p/struts2webflow/ |
Download | http://code.google.com/p/struts2webflow/downloads/list |
The Spring Webflow plugin integrates Spring Webflow (SWF) with Struts 2. It allows Struts 2 to execute spring webflows and allows spring webflows to have Struts 2 actions as webflow actions. There is also a sample car insurance app that illustrates usage of the plugin.
See http://code.google.com/p/struts2plugin-maven-repo/ if you use maven.
For non-maven users, this plugin can be installed by copying the plugin jar into your application's /WEB-INF/lib directory.
For background information on the core Spring Webflow concepts, visit http://www.ervacon.com/products/swf/intro/.
The Struts2FlowAdapter allows a Struts 2 action to execute a webflow action-state. The Struts2FlowAdapter uses the id of the action state as the name of Struts 2 action to execute. The alwaysRedirectOnPause is disabled because whether to redirect or not is easier to control in the Struts 2 configuration files.
The SessionFlowExecKeyInterceptor puts the flow execution key in the session rather than having it as a hidden field on the form that submitted back. The AnnotationFlowScopeInterceptor uses annotations to bind Struts 2 action variables to and from flow scope. Before an action executes, this interceptor looks for @FlowIn annotated properties of the Struts 2 action and populates the these actions from flow scope. After the action has executed, properties annotated with the @FlowOut annotation are put back into flow scope.
For each view-state defined in the flow xml definition, there should be a corresponding result entry in the FlowAction definition. (Or a global result for that view-state)
The flow can now be launched by accessing the FlowAction.