Introduction to
Spring Web Flow
This chapter will provide a high-level introduction to Spring Web Flow, a framework for man-
aging complex page navigation and conversational scope within web applications. At the end
of this chapter you will
•Understand the motivation for Spring Web Flow
•Be familiar with the terms and concepts within Spring Web Flow
What Itch Does Spring Web Flow Scratch?
Today, the Java Servlet specification (http://www.jcp.org/aboutJava/communityprocess/
final/jsr154) provides developers with a standard for processing HTTP requests within a web
application.
The specification defines three different scopes that dictate the visibility and location of
objects and attributes that are associated with request processing. Table 11-1 lists the existing
scopes from the server’s perspective as we know them today.
Table 11-1.Servlet Scopes
Name Lifetime Typically Used For
Request Has the smallest lifetime, is unique to Contains data sent from the browser
each request from a browser, and will (e.g., browser headings and request
be discarded when the view is returned parameters).
to the browser.
Session Starts as soon as each unique browser Information about the current user
accesses the server, and ends if the server (user details, authentication) is usually
hasn’t received a request from that stored in this scope.
browser within a specified timeout
(default of 30 minutes) or if explicitly
destroyed. This scope allows objects to
live across requests.
Application Lives for the duration of the web Contains shared application components
application deployment. and configuration elements.
309
CHAPTER 11
■ ■ ■