Spring Web Flow

Reference Documentation


Keith Donald, Erwin Vervaet, Ross Stoyanchev

Version 1.0.5

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.

October 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 exception handlers State exception handling - XML example Flow exception handling - XML example
2.5.7. Custom exception handlers flow-beans.xml
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 custom conversation management attributes
5.2.7. A flow executor setting system execution attributes
5.2.8. A flow executor setting custom execution listeners
5.2.9. 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. Adding Spring Web Flow extensions to faces-config.xml
5.6.2. Configuring the Web Flow system
5.6.3. Launching a flow execution - JSF command link component
5.6.4. Launching a flow execution - normal HTML anchor
5.6.5. Flow definitions in a JSF environment
5.6.6. Resuming a flow execution - form bound to flow execution variables
5.6.7. Spring Web Flow JSF Integration Samples
5.6.8. A pre Spring Web Flow 1.0.2 faces-config.xml file
5.6.9. A pre Spring Web Flow 1.0.2 Web Flow system configuration
5.6.10. Resuming a flow execution - pre Spring Web Flow 1.0.2
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. Sellitem Example
6.3.1. Overview
6.3.2. Web.xml
6.3.3. Services-config.xml
6.3.4. Spring MVC Context
6.3.5. Sellitem-beans.xml
6.3.6. Sellitem-flow Flow Definition
6.3.7. Sellitem-simple-flow Flow Definition
6.3.8. Sellitem-conversation-scope-flow Flow Definition
6.4. Sellitem-JSF Example
6.4.1. Overview
6.4.2. Web.xml
6.4.3. Web Flow JSF Setup in faces-config.xml
6.4.4. Web Flow System Setup in webflow-config.xml
6.4.5. Launching the sellitem-flow
6.5. Shippingrate Example
6.5.1. Overview
6.5.2. Web.xml
6.5.3. Spring MVC Context
6.5.4. Ajax Requests
6.5.5. getRate Web Flow
6.6. Numberguess Example
6.6.1. Overview
6.6.2. Web.xml
6.6.3. Spring MVC Context
6.6.4. Higherlower Flow
6.6.5. Mastermind Flow
6.7. Flowlauncher Example
6.7.1. Overview
6.7.2. Web.xml
6.7.3. Spring MVC Context
6.7.4. Sample A Web Flow
6.7.5. Sample B Web Flow
6.8. Itemlist Example
6.8.1. Overview
6.8.2. Web.xml
6.8.3. Spring MVC Context
6.8.4. Itemlist Web Flow
6.8.5. Itemlist-alternate Web Flow
6.9. Fileupload Example
6.9.1. Overview
6.9.2. Web.xml
6.9.3. Spring MVC Context
6.9.4. Fileupload Web Flow
6.10. Birthdate Example
6.10.1. Overview
6.10.2. Web.xml
6.10.3. Struts Configuration
6.10.4. Birthdate Web Flow
6.10.5. Birthdate-alternate Web Flow
6.11. Phonebook-Portlet Example
6.11.1. Overview
6.11.2. Portal/Portlet Related Software Used in the Sample Apache Pluto Portlet MVC Framework Getting Phonebook Portlet up and Runnign with Apache Pluto
6.11.3. Portlet.xml Configuration
6.11.4. Web.xml Configuration
6.11.5. Portlet MVC Configuration