2. What's New

2.1. Spring Web Flow 2.4

This release requires JDK 1.6.

2.1.1. Java-based Configuration

Web Flow now supports a Java-based alternative for its system configuration. See the updated Chapter 10, System Setup.

Also see the booking-mvc and booking-faces samples that have been updated to use all Java config.

2.1.2. Spring MVC Flash Scope Integration

When a flow ends it can now redirect to a Spring MVC controller after saving attributes in Spring MVC's flash scope for the controller to access.

See Section 11.8, “Saving Flow Output to MVC Flash Scope”.

2.1.3. Partial JSR-303 Bean Validation

A flow definition can apply partial validation on the model through the validation-hints attribute supported on view state and transition elements.

See the section called “Partial Validation”.

2.1.4. Hibernate 4 Support

The HibernateFlowExecutionListener now supports Hibernate 4 in addition to Hibernate 3.

2.1.5. Tiles 3 Support

The AjaxTilesView now supports Tiles 3 in addition to Tiles 2.2.

2.1.6. Minimum JSF 2.0 Requirement

Java ServerFaces version 1.2 and earlier are no longer supported by Spring Web Flow, if you have not done so already you will need to upgrade to JSF 2.0 or above. In addition the Spring Faces components that were previously provided with JSF 1.2 for progressive AJAX enhancements have been removed in this release.

See Section 13.3, “Upgrading from Spring Web Flow 2.3”.

2.1.7. Portlet API 2.0 and JSF 2.0 support

The internal Portlet integration introduced in Spring Web Flow 2.2 has been upgraded for JSF 2.0 compatibility. Some of the more advanced JSF 2.0 features, such as partial state saving, are not supported in a Portlet environment, however, existing application can now upgrade to the minimum required JSF version. Upgraded projects will need to ensure that the <faces:resources> elements is included as part of their Spring configuration.

See Section 14.6, “Using Portlets with JSF”.

2.1.8. Deprecations

This release deprecates Spring.js. The deprecation includes the entire spring-js-resources module including Spring.js and Spring-Dojo.js and the bundled Dojo and CSS Framework. Also deprecated is the SpringJavascriptAjaxHandler from the spring-js module. The rest of spring-js, e.g. AjaxHandler, AjaxTilesView, will be folded into spring-webflow in a future release.

OGNL support is now deprecated.

2.2. Spring Web Flow 2.3

2.2.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.8, “Embedding a Flow On a Page”.

2.2.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.2.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.2.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.2.5. Custom ConversationManager

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

2.2.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 applications. See Section 13.9, “Redirect In Same State”.

2.2.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.3. Spring Web Flow 2.2

2.3.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.5, “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.3.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.3.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.3.4. JSF 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.