Spring Web Flow 2 Web Development
Buy it now
One Minute Bottom Line
This book teaches us how to work with Spring Web Flow 2.0.x using a scalable learning approach applying the new features, over seven well-organized chapters.
- Chapter 1: Introduction
- Chapter 2: Setup for Spring Web Flow 2
- Chapter 3: The Basics of Spring Web Flow 2
- Chapter 4: Spring Faces
- Chapter 5: Mastering Spring Web Flow
- Chapter 6: Testing Spring Web Flow Applications
- Chapter 7: Security
The shortest chapter, it gives a fast introduction and explanation for:
- Spring Framework
- Spring MVC
- Spring Web Flow
and for this last one there is a mention for the three elements:
- Conversation (which includes a simple image showing a representation of many views related in a sequential way)
After that another image is used to show us the relation among the elements applied to a login process control
Following with this chapter, the new features offered by SWF 2.x are introduced like : domain-specific language, advanced controller engine, support for Ajax (rich user interfaces), support for JavaServer Faces
And the four core modules:
- Spring Web Flow
- Spring Faces
- Spring Binding
With a short explanationChapter 2: Setup for Spring Web Flow 2
This starts with details on where you can download the distribution from and furthermore what is included inside of this (shown in a simple image and an explanation for each content part; i.e.: dist, docs, etc), and what sample code is included in the distribution (i.e.: booking-faces, booking-mvc, etc)
The chapter teaches us "Build Systems" which are well covered, with Ant (even with Ivy) and Maven 2; all are used to teach us some configuration in how to work with SWF process for development cycles. It is not deep, but is easily understandable, and you have now these options to work.
An important aspect is how to work within an IDE, therefore Eclipse and NetBeans are presented. For the first Spring IDE is presented and the author teaches us how to do the configuration installation (with URL or from downloaded archive) to work with Eclipse, besides you will learn how to enable "Spring Nature" to your project (Beans and Web Flow Support)
For NetBeans, it users the NetBeans 6.1 release and teaches how install the plug-in "Spring Web MVC". The sad part that there is no support for web flow.
The author now starts with a quick login sample, using an image to show us the structure of the project, images of each view execution and its respective jspx code is there. The good part of this that the author keeps simple the understanding.
After that the flow definition with its states are introduced, using the new features (persistence context, automatic model binding). Furthermore the x-servlet.xml files with the configuration for SWF itself (JpaFlowExecutionListener, LocalContainerEntityManagerFactoryBean) is introduced; to end the web.xml file is presentedChapter 3: The Basics of Spring Web Flow 2
An interesting chapter coverin a lot of things, starting with "Elements of a flow" and explaining each one of them
For them an image about the relation among these elements are offered
For the data section many topics are included, for instance explanation/configuration for persistence context are well covered, HibernateJpaVendorAdapter is mentioned, about input and variables management and flow scopes (included a good image to show us the relation among the flowscopes is offered) are explained too
Something very important are the states of the flow. In this chapter there is a table explaining each point of execution (i.e.: on-start, on-entry...) with a snippet of xml code and an explanation of its use. Configuration for FlowRegistry, FlowExecutor, and FlowExecutor Listeners are covered too Subflow is covered more in chapter 5
Something new and very useful is Inheritance for flow definitions, which is well covered with a practical image for this new feature, a table about what is able to merge and what is not for the elements is available (I like this)Chapter 4: Spring Faces
If you are a JSF developer, even I can remember reading in the Spring forum about some problems surrounding support and integration with JSF working with SWF 1.0.x. This chapter offers how to resolve this with "Spring Faces".
The chapter starts with an explanation on how to enable this support, therefore web.xml, faces-config.xml and applicationContext.xml is well covered and explained for its each respective configurations. A table for many tags available in the Spring Faces library is available too.
Now a good example is included (about a simple bug report and a report of each one of them), a table for many namespaces (like faces) is available and all these are used for a header declaration, followed with the body of the same document. Of course, the author assumes that the reader already has knowledge of JSF, but even if you are not familiar with JSF is easily understandable. Something interesting with that file is that the author works with templates (composition - a Facelet component), like tiles.
After that the web parts that should be inserted (ui: insert) are covered and the submit events for JSF with relation to transition in a view-state is covered
To end the chapter, the author offers us good concrete material about integration about JSF with component libraries for example JBoss RichFaces, Apache MyFaces Trinidad.Chapter 5: Mastering Spring Web Flow
Here the author goes deeper into SubFlows -you will learn how to change a flow that is to be reused, how a subflow for other flow, and of course how declare the subflow
Chapter 6: Testing Spring Web Flow Applications
This chapter shows how to work with JUnit 3.8.x or higher, and a flow definition is introduced (login process). Then Testing methods (snippet code) are introduced using MockExternalContext, startFlow, assertFlowExecutionOutcomeEquals, etc, a detailed explanation about how works is included.
Testing Persistent contexts is mentioned with important information about a bug for SWF 2.0.5 related with assertFlowExecutionOutcomeEquals, therefore how Persistence is handled since chapter two is mandatory for our testing. To handle this, EasyMock is introduced and you will learn how it works and how setup the The Persistence with Testing.
Going deeper now is the turn for Testing subflows - a subflow definition is presented and how to handle this with EasyMock.
To end the chapter more tips about EasyMock are presented, like configuration for Maven, how to work with resourceFactory, register beans and how handle the transitions for states with testing.Chapter 7: Security
Security is an important area that must be considered always. Here the author starts with a brief introduction and how to install "Spring Security". After that he starts with a basic authentication related to http (snippet xml code). Following with the web.xml configuration, the author goes deeper about advanced configurations for security, here he use the interface "AccessDecisionVoter", then the author uses the data access strategy
To end the chapter "Spring Security" with "Spring Web Flow" with a sample based in changing the user's password is explained.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)