Spring Web Flow

Reference Documentation


Keith Donald, Erwin Vervaet, Ross Stoyanchev

Version 1.0.1

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.

January 2007


Spring Web Flow would not be possible without the investment of its sponsors: Interface21 and Ervacon.

Table of Contents

1. Introduction
1.1. Overview
1.2. Architecture overview
1.3. Architectural layers
1.4. Layer descriptions
1.4.1. The Execution Core Layer (Bottom Layer)
1.4.2. The Execution Engine Layer
1.4.3. The Test Layer
1.4.4. The Executor Layer
1.4.5. The System Configuration Layer (Top Layer)
1.5. Support
2. Flow definition
2.1. Introduction
2.2. FlowDefinition
2.2.1. XML-based Flow template
2.2.2. Java Flow API example
2.3. StateDefinition
2.4. Transitionable State
2.4.1. XML-based state template
2.4.2. Java state API example
2.5. TransitionDefinition
2.5.1. Transition XML template
2.5.2. Transition Java API example
2.5.3. Action transition execution criteria
2.5.4. Dynamic transitions
2.5.5. Global transitions Global transitions - XML example
2.5.6. Transition executing state exception handlers Exception handling - XML example
2.6. Concrete state types
2.6.1. ViewState ViewSelector ViewState class diagram ViewState XML - application view selection ViewState API - application view selection ViewState XML - flow execution redirect ViewState API - flow execution redirect ViewState XML - null view FlowDefinitionRedirect and ExternalRedirect ViewState XML - form state behavior
2.6.2. ActionState Action execution points Action attributes ActionState class diagram ActionState XML - simple action execution ActionState API - standard action ActionState XML - multi action ActionState API - multi action ActionState XML - bean action ActionState XML - decision bean action ActionState XML - decision bean action with enum return value ActionState XML - evaluate action ActionState XML - set action When to use which kind of action?
2.6.3. DecisionState DecisionState XML - expression evaluation
2.6.4. SubflowState SubflowState XML - with input attribute SubflowState API - input attributes Flow input mapping - input contract
2.6.5. EndState EndState result events EndState Properties EndState XML - redirect to flow after completion EndState XML - redirect after flow completion EndState XML - flow output attribute EndState API - flow output attribute SubflowState XML - mapping an output attribute
3. Flow execution
3.1. Introduction
3.2. FlowExecution
3.2.1. Flow execution creation
3.2.2. Flow execution startup
3.2.3. Flow execution resume
3.2.4. Flow execution lifecycle
3.2.5. Flow execution properties
3.2.6. Flow execution impl creation
3.3. Flow execution context
3.4. Flow execution scopes
3.5. Flow execution testing
3.5.1. Flow execution test example
3.5.2. Execution unit testing vs. full-blown system testing
4. Flow execution repositories
4.1. Introduction
4.2. Repository architecture overview
4.3. Flow execution identity
4.3.1. Conversation identifier
4.3.2. Continuation identifier
4.3.3. Flow execution key
4.4. Conversation ending
4.5. Flow execution repository implementations
4.5.1. Simple flow execution repository
4.5.2. Continuation flow execution repository
4.5.3. Client continuation flow execution repository
5. Flow executors
5.1. Introduction
5.2. FlowExecutor
5.2.1. FlowExecutorImpl
5.2.2. A typical flow executor configuration with Spring 2.0
5.2.3. A flow executor using a simple execution repository
5.2.4. A flow executor using a client-side continuation-based execution repository
5.2.5. A flow executor using a single key execution repository
5.2.6. A flow executor setting system execution attributes
5.2.7. A flow executor setting custom execution listeners
5.2.8. A Spring 1.2 compatible flow executor configuration
5.3. Spring MVC integration
5.3.1. A single flow controller executing all flows in a Servlet MVC environment
5.3.2. A single portlet flow controller executing a flow within a Portlet
5.4. Flow executor parameterization
5.4.1. Request parameter-based flow executor argument extraction Launching a flow execution - parameter-style anchor Launching a flow execution - form Resuming a flow execution - anchor Resuming a flow execution - form Resuming a flow execution - multiple form buttons Refreshing a flow execution
5.4.2. Request path based flow executor argument extraction A flow controller with a request-path based argument extractor Launching a flow execution - REST-style anchor Resuming a flow execution - multiple form buttons Refreshing a flow execution
5.5. Struts integration
5.5.1. A single flow action executing all flows
5.6. Java Server Faces (JSF) integration
5.6.1. A typical faces-config.xml file
5.6.2. Launching a flow execution - command link
5.6.3. Resuming a flow execution - form
6. Practical Use of Spring Web Flow
6.1. Sample applications
6.2. Running the Web Flow sample applications
6.2.1. Building from the Command Line
6.2.2. Importing Projects into Eclipse
6.2.3. Deploying projects inside Eclipse using Eclipse Web Tools (WTP)
6.2.4. Other IDE's
6.3. Fileupload Example
6.3.1. Overview
6.3.2. Web.xml
6.3.3. Spring MVC Context
6.3.4. Fileupload Web Flow
6.4. Birthdate Example
6.4.1. Overview
6.4.2. Web.xml
6.4.3. Struts Configuration
6.4.4. Birthdate Web Flow
6.4.5. Birthdate-alternate Web Flow