Chapter 5. Enhancing Spring MVC applications with Web Flow


This chapter covers

  • An introduction to Spring Web Flow
  • Building a Spring soccer demo application
  • Using action classes
  • Working with form data-binding and validation
  • Understanding flow and state inheritance
  • Securing web flows

Most enterprise Java developers have worked on web applications that have some sort of workflow component to them. Classic use cases consist of searching for products, booking a flight, and preparing your tax return. But without the right tools, determining how to manage this workflow can be a challenge.

Model-view-controller (MVC) frameworks work best in situations where the unit of work required to create or update the model can be implemented in a minimal number of views. By itself, though, the MVC pattern doesn’t provide an efficient mechanism for managing a series of intermediate steps, their rules, and states that span multiple requests. As a result, page-flow logic typically seeps into both the view and controller tiers whereas the application state required to support the page-flow logic is often spread between a combination of session and request parameters. As a result, understanding, maintaining, and testing complex page flows in an MVC application can quickly become an arduous task.

5.1. Is Spring Web Flow right for you?

5.2. An overview of Spring Web Flow

5.3. The Spring Soccer Club demo application

5.4. Using action classes

5.5. Form data binding

5.6. Form validation

5.7. Flow and state inheritance

5.8. Securing web flows

5.9. Summary