2. What's New

2.1. Spring Web Flow 2.3

2.1.1. Embedding A Flow On A Page

By default Web Flow does a client-side redirect upon entering every view state. That makes it impossible to embed a flow on a page or within a modal dialog and execute more than one view state without causing a full-page refresh. Web Flow now supports launching a flow in "embedded" mode. In this mode a flow can transition to other view states without a client-side redirect during Ajax requests. See Section 11.7, “Embedding A Flow On A Page” and Section 13.9, “Embedding a Flow On a Page”.

2.1.2. Support For JSR-303 Bean Validation

Support for the JSR-303 Bean Validation API is now available building on equivalent support available in Spring MVC. See Section 5.10, “Validating a model” for more details.

2.1.3. Flow-Managed Persistence Context Propagation

Starting with Web Flow 2.3 a flow managed PersistenceContext is automatically extended (propagated) to sub-flows assuming the subflow also has the feature enabled as well. See Section 7.3, “Flow Managed Persistence And Sub-Flows”.

2.1.4. Portlet 2.0 Resource Requests

Support for Portlet 2.0 resource requests has now been added enabling Ajax requests with partial rendering. URLs for such requests can be prepared with the <portlet:resourceURL> tag in JSP pages. Server-side processing is similar to a combined an action and a render requests but combined in a single request. Unlike a render request, the response from a resource request includes content from the target portlet only.

2.1.5. Custom ConversationManager

The <flow-execution-repository> element now provides a conversation-manager attribute accepting a reference to a ConversationManager instance.

2.1.6. Redirect In Same State

By default Web Flow does a client-side redirect when remaining in the same view state as long as the current request is not an Ajax request. This is useful after form validation failure. Hitting Refresh or Back won't result in browser warnings. Hence this behavior is usually desirable. However a new flow execution attribute makes it possible to disable it and that may also be necessary in some cases specific to JSF 2 applications. See Section 13.10, “Redirect In Same State”.

2.1.7. Samples

The process for building the samples included with the distribution has been simplified. Maven can be used to build all samples in one step. Eclipse settings include source code references to simplify debugging.

Additional samples can be accessed as follows:

mkdir spring-samples
cd spring-samples
svn co https://src.springframework.org/svn/spring-samples/webflow-primefaces-showcase
cd webflow-primefaces-showcase
mvn package
# import into Eclipse

mkdir spring-samples
cd spring-samples
svn co https://src.springframework.org/svn/spring-samples/webflow-showcase
cd webflow-showcase
mvn package
# import into Eclipse

2.2. Spring Web Flow 2.2

2.2.1. JSF 2 Support

Comprehensive JSF 2 Support

Building on 2.1, Spring Web Flow version 2.2 adds support for core JSF 2 features The following features that were not supported in 2.1 are now available: partial state saving, JSF 2 resource request, handling, and JSF 2 Ajax requests. At this point support for JSF 2 is considered comprehensive although not covering every JSF 2 feature -- excluded are mostly features that overlap with the core value Web Flow provides such as those relating to navigation and state management.

See Section 13.4, “Configuring Web Flow for use with JSF” for important configuration changes. Note that partial state saving is only supported with Sun Mojarra 2.0.3 or later. It is not yet supported with Apache MyFaces. This is due to the fact MyFaces was not as easy to customize with regards to how component state is stored. We will work with Apache MyFaces to provide this support. In the mean time you will need to use the javax.faces.PARTIAL_STATE_SAVING context parameter in web.xml to disable partial state saving with Apache MyFaces.

Travel Sample With the PrimeFaces Components

The main Spring Travel sample demonstrating Spring Web Flow and JSF support is now built on JSF 2 and components from the PrimeFaces component library. Please check out the booking-faces sample in the distribution.

Additional samples can be found at the Spring Web Flow - Prime Faces Showcase, an SVN repository within the spring-samples repository. Use these commands to check out and build:

svn co https://src.springframework.org/svn/spring-samples/webflow-primefaces-showcase
	cd webflow-primefaces-showcase
	mvn package
	

2.2.2. Spring Security Facelets Tag Library

A new Spring Security tag library is available for use with with JSF 2.0 or with JSF 1.2 Facelets views. It provides an <authorize> tag as well as several EL functions. See Section 13.11, “Using the Spring Security Facelets Tag Library” for more details.

2.2.3. Spring JavaScript Updates

Deprecated ResourcesServlet

Starting with Spring 3.0.4, the Spring Framework includes a replacement for the ResourcesServlet. Please see the Spring Framework documentation for details on the custom mvc namespace, specifically the new "resources" element.

Dojo 1.5 and dojox

The bundled custom Dojo build is upgraded to version 1.5. It now includes dojox.

Note that applications are generally encouraged to prepare their own custom Dojo build for optimized performance depending on what parts of Dojo are commonly used together. For examples see the scripts used by Spring Web Flow to prepare its own custom Dojo build.

Two Spring JS artifacts

The spring-js artifact has been split in two -- the new artifact (spring-js-resources) contains client side resource (.js, .css, etc.) while the existing artifact (spring-js) contains server-side Java code only.

Applications preparing their own custom Dojo build have an option now to avoid including spring-js-resources and put Spring.js and Spring-Dojo.js directly under the root of their web application.

Client resources moved into META-INF/web-resources

Bundled client resources (.js, .css, etc.) have been moved to META-INF/web-resources from their previous location under META-INF. This change is transparent for applications but will result in simpler and safer configuration when using the new resource handling mechanism available in Spring 3.0.4.

2.2.4. JFS Portlet Support

Portlet API 2.0 and JSF 1.2 support

In previous versions of Spring Web Flow support for JSF Portlets relied on a Portlet Bridge for JSF implementation and was considered experimental. Spring Web Flow 2.2 adds support for JSF Portlets based on its own internal Portlet integration targeting Portlet API 2.0 and JSF 1.2 environments. See Section 14.6, “Using Portlets with JSF” for more details. The Spring Web Flow Travel JSF Portlets sample has been successfully tested on the Apache Pluto portal container.