Spring Web Flow

Reference Documentation

Authors

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


Sponsors

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

Table of Contents

Preface
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
2.5.5.1. Global transitions - XML example
2.5.6. Transition executing exception handlers
2.5.6.1. State exception handling - XML example
2.5.6.2. Flow exception handling - XML example
2.5.7. Custom exception handlers
2.5.7.1. flow-beans.xml
2.6. Concrete state types
2.6.1. ViewState
2.6.1.1. ViewSelector
2.6.1.2. ViewState class diagram
2.6.1.3. ViewState XML - application view selection
2.6.1.4. ViewState API - application view selection
2.6.1.5. ViewState XML - flow execution redirect
2.6.1.6. ViewState API - flow execution redirect
2.6.1.7. ViewState XML - null view
2.6.1.8. FlowDefinitionRedirect and ExternalRedirect
2.6.1.9. ViewState XML - form state behavior
2.6.2. ActionState
2.6.2.1. Action execution points
2.6.2.2. Action attributes
2.6.2.3. ActionState class diagram
2.6.2.4. ActionState XML - simple action execution
2.6.2.5. ActionState API - standard action
2.6.2.6. ActionState XML - multi action
2.6.2.7. ActionState API - multi action
2.6.2.8. ActionState XML - bean action
2.6.2.9. ActionState XML - decision bean action
2.6.2.10. ActionState XML - decision bean action with enum return value
2.6.2.11. ActionState XML - evaluate action
2.6.2.12. ActionState XML - set action
2.6.2.13. When to use which kind of action?
2.6.3. DecisionState
2.6.3.1. DecisionState XML - expression evaluation
2.6.4. SubflowState
2.6.4.1. SubflowState XML - with input attribute
2.6.4.2. SubflowState API - input attributes
2.6.4.3. Flow input mapping - input contract
2.6.5. EndState
2.6.5.1. EndState result events
2.6.5.2. EndState Properties
2.6.5.3. EndState XML - redirect to flow after completion
2.6.5.4. EndState XML - redirect after flow completion
2.6.5.5. EndState XML - flow output attribute
2.6.5.6. EndState API - flow output attribute
2.6.5.7. 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
5.4.1.1. Launching a flow execution - parameter-style anchor
5.4.1.2. Launching a flow execution - form
5.4.1.3. Resuming a flow execution - anchor
5.4.1.4. Resuming a flow execution - form
5.4.1.5. Resuming a flow execution - multiple form buttons
5.4.1.6. Refreshing a flow execution
5.4.2. Request path based flow executor argument extraction
5.4.2.1. A flow controller with a request-path based argument extractor
5.4.2.2. Launching a flow execution - REST-style anchor
5.4.2.3. Resuming a flow execution - multiple form buttons
5.4.2.4. 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
6.11.2.1. Apache Pluto
6.11.2.2. Portlet MVC Framework
6.11.2.3. 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