Spring Web Flow is an open-source web development framework and part of the Spring product portfolio. Its primary purpose is to define the (work) flow of a web application. The flow is independent of the implementation and thus the infrastructure of your application. This enables developers accustomed with Spring Web Flow to write powerful and re-usable web applications that are easy to maintain and enhance. Along with the Spring Web Flow distribution, additional libraries are shipped. These libraries make it easier for developers to improve their applications with compelling AJAX functionality. It also includes Spring Faces, which combines Spring Web Flow with the powerful JavaServer Faces technology to create feature-rich graphical user interfaces. You will find explanations about all this and much more in this book.
Chapter 1: Introduction gives an introduction to the world of Spring Web Flow. Additionally, the chapter covers important definitions that you need to know to understand the following chapters.
Chapter 2: Setup for Spring Web Flow 2 shows how to install Spring Web Flow and create the first small application. It also shows the usage of the examples that are provided in the Spring Web Flow distribution.
Chapter 3: The Basics of Spring Web Flow 2 covers all the basics that are essential to build applications with Spring Web Flow. It also explains all the essential things about the flow definition file.
Chapter 4: Spring Faces gives an overview and also a detailed explanation on the usage of Spring Faces with Spring Web Flow. For better understanding, it also explains the essential basics around JavaServer Faces.
Chapter 5: Mastering Spring Web Flow covers advanced topics, for example, the usage of subflows and the new Spring JavaScript library that ships with Spring Web Flow for the first time. The chapter also covers an in-depth look into the flow definition file.
Chapter 6: Testing Spring Web Flow Applications covers the important topic of testing applications that are developed with Spring Web Flow. It shows the integrated support of JUnit (http://www.junit.org) and includes step-by-step instructions showing how to test your applications.
Chapter 7: Security shows how to secure applications that are developed with Spring Web Flow using Spring Security.
Appendix A: flow.trac—The Model for the Examples describes the classes in the sample project, flow.trac
. These classes are used in the examples of this book.
Appendix B: Running on the SpringSource dm Server explains how to run a Spring Web Flow application on the SpringSource Application Platform (AP).
For the examples in this book, we have used the following software packages:
Java Development Kit (JDK) 6
Spring Web Flow 2.0.x
Eclipse 3.4.x and NetBeans 6.1
Apache Tomcat 6.0.18
Apache Ant 1.7.1 / Apache Ivy 2.0.0 RC1
Apache Maven 2.0.9
Microsoft® SQL Server 2008 Express Edition
Microsoft® SQL JDBC Database Driver 1.2
Hibernate Core 3.3.1 GA, Hibernate Annotations 3.4.0 GA, and Hibernate EntityManager 3.4.0 GA
SpringSource dm Server 1.0.x
This book is targeted at Java web application developers who work with Spring Web Flow. This book is a must-read for those who wish to bridge the gap between the popular web framework and the popular application framework, and also for those who want to create powerful and re-usable web applications. It requires prior knowledge of Spring.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: "Next, we define a custom view resolver with a special viewClass
property."
A block of code will be set as follows:
<dependency> <groupId>org.springframework.webflow</groupId> <artifactId>org.springframework.js</artifactId> <version>2.0.5.RELEASE</version> </dependency>
When we wish to draw your attention to a particular part of a code block, the relevant lines or items will be shown in bold:
<end-state id="success" commit="true" />
<end-state id="failedView" view="failedView.jspx" />
Any command-line input or output is written as follows:
mvn clean compile war:exploded
New terms and important words are shown in bold. Words that you see on the screen, in menus, or dialog boxes for example, appear in our text like this: "If you click on the Next button, a request to the server will be sent which renders a new web site using Tiles."
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply drop an email to <[email protected]>
, and mention the book title in the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email <[email protected]>
.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Visit http://www.packtpub.com/files/code/5425_Code.zip to directly download the example code.
The downloadable files contain instructions on how to use them.
Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration, and help us to improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to any list of existing errata. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or web site name immediately so that we can pursue a remedy.
Please contact us at <[email protected]>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]>
if you are having a problem with any aspect of the book, and we will do our best to address it.