whatsnew.md 10.9 KB
Newer Older
茶陵後's avatar
茶陵後 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
# 2. What's New

## 2.1. Spring Web Flow 2.5

This release provides an upgrade path to Spring Framework 5 that in turn requires
Java 8+, Servlet 3.1, Hibernate 5, Tiles 3. See the[Spring Framework wiki](https://github.com/spring-projects/spring-framework/wiki/What%27s-New-in-Spring-Framework-5.x)for more details. The [samples repository](https://github.com/spring-projects/spring-webflow-samples)has been upgraded to Spring Web Flow 2.5.

As of 2.5 there is no longer a *spring-js* module. The classes from that module
have been kept but moved to new packages in the *spring-webflow* module.
The *spring-js-resources* module is available as an optional module that
must be included explicitly.

This release requires JSF 2.2 or higher.

## 2.2. Spring Web Flow 2.4

This release requires JDK 1.6.

### 2.2.1. Java-based Configuration

Web Flow now supports a Java-based alternative for its system configuration.
See the updated [Chapter 10, *System Setup*](system-setup.html).

Also see the[booking-mvc](https://github.com/spring-projects/spring-webflow-samples/tree/master/booking-mvc) and[booking-faces](https://github.com/spring-projects/spring-webflow-samples/tree/master/booking-faces)samples that have been updated to use all Java config.

### 2.2.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”](spring-mvc.html#spring-mvc-flash-output).

### 2.2.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”](views.html#view-validation-jsr303-partial).

### 2.2.4. Hibernate Support

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

As of 2.4.4 the `HibernateFlowExecutionListener` also works with Hibernate 5.

### 2.2.5. Tiles 3 Support

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

### 2.2.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 [???]().

### 2.2.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.

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

### 2.3.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”](spring-mvc.html#spring-mvc-embedded-flow) and [Section 13.6, “Embedding a Flow On a Page”](spring-faces.html#spring-faces-embedded-mode).

### 2.3.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”](views.html#view-validate) for more details.

### 2.3.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”](flow-managed-persistence.html#flow-managed-persistence-propagation).

### 2.3.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.3.5. Custom ConversationManager

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

### 2.3.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.7, “Redirect In Same State”](spring-faces.html#spring-faces-redirect-in-same-state).

### 2.3.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.4. Spring Web Flow 2.2

### 2.4.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.3, “Configuring Web Flow for use with JSF”](spring-faces.html#spring-faces-webflow-config) 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](https://src.springframework.org/svn/spring-samples/webflow-primefaces-showcase), an SVN repository within the[spring-samples](https://src.springframework.org/svn/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.4.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.9, “Using the Spring Security Facelets Tag Library”](spring-faces.html#spring-faces-security-taglib) for more details.

### 2.4.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"](http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-static-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](https://src.springframework.org/svn/spring-webflow/branches/spring-webflow-2.2-maintenance/spring-js-resources/scripts/dojo)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.4.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 [???]() for more details.
The Spring Web Flow Travel JSF Portlets sample has been successfully
tested on the Apache Pluto portal container.