Table Of Contents
1. Introduction to Spring Web Flow
2. Setup of Spring Web Flow 2
3. The basics of Spring Web Flow 2
4. Spring Faces (Downloadable for free!! : http://www.packtpub.com/files/spring-web-flow-2-web-development-sample-chapter-4-spring-faces.pdf)
5. Mastering Spring Web Flow
6. Testing Spring Web Flow Applications
Appendix A : flow.trac:The Model for the Examples
Appendix B : Running on the SpringSource dm Server
For those who would like to choose a web framework, this book deserves a glance.
From the documentation, Spring Web Flow is the module of Spring for implementing flows. The Web Flow engine plugs into the Spring Web MVC platform and provides declarative flow definition language.
The book directly dives into the details of the Spring Web Flow and where it stands as compared to the other layers of Spring like MVC. It has covered Spring Web Flow 2.0 in great depth and gets the Version 1 users up to speed with “whats changed”. Chapter 2 deals with the development environment and with this the book makes an exception from the (in)famous Hello World example into something more sophisticated. Now this is big in Spring where the web site lists simple one liner examples (most of them from the older versions – I have personally submitted bugs 😦 )
I like the way they explain the initial setup like
1. Build tools : Ant, Maven
2. The IDE configuration in Eclipse with “Spring IDE plugin” and Netbeans “Spring MVC plugin” is covered. Although IntelliJ and the Spring Source Tool Suite is missing.
There is also a quick start tutorial with examples (example applications provided within the Spring distributions), service and database layers, deployment description and dependencies (web flow, beans, views DispatcherServlet)
Spring Web Flow 2 release effort addresses two major themes: Integration and Simplicity. It focuses on providing the infrastructure for building and running rich web applications. As a Spring project, Web Flow builds on the Spring Web MVC framework to provide:
- A domain-specific-language for defining reusable controller modules called flows
- An advanced controller engine for managing conversational state
- First-class support for using Ajax to construct rich user interfaces
- First-class support for using JavaServerFaces with Spring
Modules of Spring Web Flow 2 :
Spring Web Flow
The book is written in a very simple understandable language in a step by step manner interlacing the code, explanation and example to create a running application in the end. Chapter 3 delves into the basics of Spring web flow including the elements of flow, entry point, section data, states, exit point, section footer and configuration (FlowRegistry, FlowExecuter etc..) There is a little bit about validation.
After the flows it moves to Spring Faces (integrates rich user interface with support for JSF) to deliver the GUI of the web application. Just the basics of JSF are explained to bring others up to speed. There are good details about the configuration (enabling Spring Faces support, ResourceServlet, application context) and the integration with other JSF component libraries like JBoss RichFaces and Apache MyFaces. There is a detailed listing of all the tags available in Spring Faces and a complete example of create input page, handling errors, actions of buttons, display of results. Note: the code is interspersed in the explanation. An important part of Chapter 4 is the explanation of the integration of RichFaces (richfaces is a component library for JSF).
Spring Web Flow has good support for unit test and the book has an exhaustive discussion on testing web flows including MockExternalContext, startFlow(), assert(), resumeFlow(). It explains how to test your flows, subflows, persistence contexts and also gives a short introduction to EasyMock, which helps you to create mock implementations of your interfaces to test services. There is a sample example and explanation of how to integrate a test-driven development approach.
The last chapter deals with integration of Spring Security in the Spring Web Flow – how to set it up, web.xml, application context configuration and advanced configuration, the different types of AccessDecisionManagers, AccessDecisionVoter, how to define roles and authorities and SecurityFlowExecutionListener. The example given shows how to retrieve users from a database and secure parts of a webpage or a method and changing user’s password.
And finally I read an interesting aspect of buying books from Packt publishing which is their commitment to open source. A great way to give back to the Open Source ecosystem.
“Packt Open Source Project Royalties”
When we sell a book written on an Open Source project, we pay a royalty directly to that project. Therefore by purchasing Spring Web Flow 2 Web Development, Packt will have given some of the money received to the Spring project.
Who can use the book:
Any beginner who wants to use the power of Spring web flow. It assumes prior basic knowledge of Spring and configuration. If you get into details you would need to know the basics of specific techniques like JSF, security before you can go though the chapter although there are some starting points.
The source code for the book can be downloaded at http://www.packtpub.com/files/code/5425_Code.zip
Paperback: 272 pages
Publisher: Packt Publishing (March 20, 2009)
Product Dimensions: 9.2 x 7.5 x 0.7 inches
About the Authors (As on the site)
Sven Lüppken has a degree in computer science, which he passed with distinction. He is currently employed as Java Software Developer at one of the leading broadcasting and production companies in Germany. Sven started programming in C and C++ at the age of 16 and quickly fell in love with the Java programming language during his studies.
When he got the chance to write his diploma thesis about object-relational mapping technologies he accepted at once.
Since then, he has integrated Hibernate and the JPA in many projects, always in conjunction with the Spring framework.
Markus Stäuble is currently working as CTO at namics (deutschland) gmbh. He has a Master degree in Computer Science. He started programming with Java in the year 1999. After that he has earned much experience in building enterprise java systems, especially web applications. He has a deep knowledge of the java platform and the tools and frameworks around Java.