Name | ActionFlow Plugin |
---|---|
Publisher | |
License | Open Source (ASL2) |
Version | 2.3.04 |
Compatibility | Struts 2.3.4 + |
Homepage |
...
Wiki Markup
Overview
A Struts2INLINE
plugin plugin for creating wizards (action flows) Excerpt
...
Features Overview
- Simple integration to new or existing Struts2 application
- Automatic use of Post/Redirect/Get pattern to avoid duplicate form submissions
- Proper handling of browser back and refresh buttons
- Action flow scope to keep data, there is no need to use scoped model-driven
actions
Showcase
Showcase application could be downloaded from the Maven Central Repository.
Download struts2-actionflow-showcase
Contributing
Found a bug or have a feature request? Create a new issue or submit a Pull Request.
Questions
If you have questions about how to use struts2-actionflow-plugin
create a new issue or ask a question on Stack Overflow.
Installation
Copy struts2-actionflow-plugin-x.x.x.jar into your classpath WEB-INF/lib
. No other files need to be copied or created.
If you are using Maven, add this to your project POM:
...
...
Example Usage
1. Install it by adding this plug-in dependency to your POM or by copying jar into /WEB-INF/lib directory.
2. Make your action package extend actionflow-default
package.
3. Add <param name="actionFlowStep">
parameters to actions you want to include in action flows. (NOTE: the action must have an input result!)
4. Use next
and prev
actions in JSP to move between wizard steps.
5. Use @ActionFlowScope
annotation on action classes and fields in order to keep data in action flow scope.
Action Mappings
...
Form
...
Note: Since Struts2 version 2.3.15.3 if you are using <s:submit>
tags with action
attribute you need to enable support for action:
prefix.
Put that in your struts.xml file:
...
...
Action
...
...
Showing action flow steps in JSP
...
Implement ActionFlowStepsAware
interface in action and create getter for ActionFlowStepsData
:
...
In JSP iterate over ActionFlowStepsData#steps
map. Use #key
and #value
to get step index (starting from 1) and action name. The ActionFlowStepsData#stepIndex
property holds index of current step.
...
...
Controlling action flow
Available from struts2-actionflow-plugin 2.3.0
...
As a result of that you can skip actions based on user input and current action name.
...