While writing action code as POJO logic is the most common, there are several other action implementation options.
Sometimes you need to write action code that needs access to the flow context.
You can always invoke a POJO and pass it the flowRequestContext as an EL variable.
Alternatively, you may implement the Action
interface or extend from the MultiAction
base class.
These options provide stronger type safety when you have a natural coupling between your action code and Spring Web Flow APIs.
Examples of each of these approaches are shown below.
<evaluate expression="pojoAction.method(flowRequestContext)" />
public class PojoAction { public String method(RequestContext context) { ... } }
<evaluate expression="customAction" />
public class CustomAction implements Action { public Event execute(RequestContext context) { ... } }