diff --git a/spring-js/src/main/java/org/springframework/js/resource/ResourceServlet.java b/spring-js/src/main/java/org/springframework/js/resource/ResourceServlet.java
index fbf1734e..7df548ef 100644
--- a/spring-js/src/main/java/org/springframework/js/resource/ResourceServlet.java
+++ b/spring-js/src/main/java/org/springframework/js/resource/ResourceServlet.java
@@ -48,6 +48,9 @@ import org.springframework.web.servlet.HttpServletBean;
*
* @author Jeremy Grelle
* @author Scott Andrews
+ *
+ * @deprecated Deprecated in favor of the new resource handling mechanism available in Spring 3.0.4. See the
+ * documentation on the custom mvc namespace, specifically the new resources element.
*/
public class ResourceServlet extends HttpServletBean {
diff --git a/spring-webflow-library/org.springframework.webflow-library.libd b/spring-webflow-library/org.springframework.webflow-library.libd
index 047e5017..69575c8a 100644
--- a/spring-webflow-library/org.springframework.webflow-library.libd
+++ b/spring-webflow-library/org.springframework.webflow-library.libd
@@ -5,5 +5,6 @@ Import-Bundle:
org.springframework.binding;version="[@bundle.version@, @bundle.version@]",
org.springframework.webflow;version="[@bundle.version@, @bundle.version@]",
org.springframework.js;version="[@bundle.version@, @bundle.version@]";resolution:="optional",
+ org.springframework.js.resources;version="[@bundle.version@, @bundle.version@]";resolution:="optional",
org.springframework.faces;version="[@bundle.version@, @bundle.version@]";resolution:="optional",
com.springsource.org.jboss.el;version="[2.0.0.GA, 2.1.0)";resolution:="optional"
diff --git a/spring-webflow-reference/src/overview.xml b/spring-webflow-reference/src/overview.xml
index 651d3ec1..84e7386a 100644
--- a/spring-webflow-reference/src/overview.xml
+++ b/spring-webflow-reference/src/overview.xml
@@ -52,21 +52,9 @@
This allows you to easily integrate Web Flow into your application if you are already using Maven as the build system for your web development project.
- To access Web Flow jars from Maven Central, declare the following dependencies in your pom:
+ To access Web Flow jars from Maven Central, declare the following dependency in your pom (also adds "spring-binding", "spring-js", and "spring-js-resources"):
- org.springframework.webflow
- spring-binding
- 2.2.0.RELEASE
-
-
-
- org.springframework.webflow
- spring-js
- 2.2.0.RELEASE
-
-
org.springframework.webflow
spring-webflow
@@ -75,7 +63,7 @@
]]>
- And if using JavaServerFaces:
+ If using JavaServer Faces, declare the following dependency in your pom (also adds the above dependencies):
@@ -112,21 +100,9 @@
]]>
- Then declare the following dependencies:
+ Then declare the following dependency:
- org.springframework.webflow
- org.springframework.binding
- 2.2.0.RELEASE
-
-
-
- org.springframework.webflow
- org.springframework.js
- 2.2.0.RELEASE
-
-
org.springframework.webflow
org.springframework.webflow
@@ -134,7 +110,7 @@
]]>
- And if using JavaServerFaces:
+ And if using JavaServer Faces:
@@ -169,13 +145,10 @@
]]>
- Then declare the following dependencies:
+ Then declare the following dependencies (also adds "org.springframework.binding",
+ "org.springframework.js", and "org.springframework.spring.js"):
runtime" />
-
]]>
diff --git a/spring-webflow-reference/src/portlet.xml b/spring-webflow-reference/src/portlet.xml
index d50a33f2..dc3117a9 100644
--- a/spring-webflow-reference/src/portlet.xml
+++ b/spring-webflow-reference/src/portlet.xml
@@ -185,6 +185,58 @@ externalContext.requestMap.portletMode
]]>
+
+ Using Portlets with JSF
+
+
+ Prior to version 2.1 of Spring Web Flow, support for JSF Portlets was considered
+ experimental and relied on a Portlet Bridge for JSF implementation.
+ Furthermore JSR-329 (the latest specification in this area), which targets
+ Portlet API 2.0 and JSF 1.2 environments at the time of writing is not yet
+ final causing portlet bridge implementations to also remain incomplete.
+
+
+ A closer comparison of Spring Web Flow and a Portlet Bridge for JSF shows
+ the two have significant overlap. They both drive the
+ JSF lifecycle and they both shield JSF from knowledge about Portlet action
+ and render requests.
+
+
+ Considering all of the above, starting with version 2.2, Spring Web Flow
+ provides support for JSF Portlets using its own internal Portlet integration rather
+ than a Portlet Bridge for JSF. We believe this will provide value for Web Flow users
+ by reducing the number of dependencies in what is already a fairly complex
+ combination of technologies with specifications lagging behind.
+
+
+ What this practically means is the configuration required for JSF Portlets is
+ very similar to what is alread documented in the rest of this chapter
+ with the exception of , which is not necessary
+ with JSF.
+
+
+ Review the swf-booking-portlet-faces sample in the Web Flow distribution
+ for a working JSF Portlets example with complete configuration details. The main thing
+ you'll need to notice in addition to what has already been described in this
+ chapter is the faces-config.xml configuration:
+
+
+
+
+
+
+
+
+ org.springframework.faces.webflow.application.portlet.PortletFaceletViewHandler
+
+
+
+]]>
+
+
+
Issues in a Portlet Environment
@@ -213,17 +265,5 @@ externalContext.requestMap.portletMode
One way to start a new flow is to create a URL targeting the mode without the execution key.
-
- Portlets and JSF
-
- Web Flow supports JSF as the view technology for a portlet.
- However, a jsf-portlet bridge (JSR-301) must be provided.
- At the time of this writing, no feature complete jsf-portlet bridge exists.
- Some of the existing bridge implementations may appear to work, however, side effect may occur.
-
-
- JSF portlets are considered experimental at this time.
-
-
diff --git a/spring-webflow-reference/src/spring-faces.xml b/spring-webflow-reference/src/spring-faces.xml
index 85bddd63..ddf5e20e 100644
--- a/spring-webflow-reference/src/spring-faces.xml
+++ b/spring-webflow-reference/src/spring-faces.xml
@@ -6,11 +6,24 @@
Introduction
- Spring Web Flow provides an integration that simplifies using JSF with Spring. It lets you use the
- JSF UI Component Model with Spring MVC and Spring Web Flow controllers.
+ Spring Web Flow provides an integration that simplifies using with Spring. It lets you use the
+ JSF UI Component Model with Spring MVC and Spring Web Flow controllers. As of Spring Web Flow
+ 2.2 the JSF integration is supported with JSF 1.2 and JSF 2.0 including Sun Mojarra and Apache
+ MyFaces. Please, note however that JSF 2 partial state saving is not yet supported with
+ Apache MyFaces and needs to be disabled with the javax.faces.PARTIAL_STATE_SAVING
+ context parameter in web.xml
- A small Facelets component library that provides Ajax and client-side validation capabilities is also shipped with Web Flow.
+ Spring Web Flow provides a Spring Security tag library for JSF 2 and JSF 1.2 environments.
+ It provides an <authorize> tag as well as several EL functions.
+ See for more details.
+
+
+ A small Facelets component library that provides Ajax and client-side validation capabilities
+ in JSF 1.2 environments only is also shipped with Web Flow. Note that this library will not
+ be upgraded to JSF 2.0 in favor of 3rd party component libraries such as PrimeFaces
+ and RichFaces. The swf-booking-faces sample in the Spring Web Flow distribution
+ is built on JSF 2 and PrimeFaces components.
@@ -87,7 +100,7 @@
]]>
- When using the Spring Faces components, you also need to configure a servlet for serving
+ When using the Spring Faces components (JSF 1.2 only), you also need to configure a servlet for serving
CSS and JavaScript resources. This servlet must be mapped
to /resources/* in order for the URL's rendered by the components to function correctly.
@@ -118,7 +131,8 @@
For optimal page-loading performance use the Spring Faces components
- includeStyles and includeScripts. These components will eagerly load the necessary
+ includeStyles and includeScripts (JSF 1.2 only).
+ These components will eagerly load the necessary
CSS stylesheets and JavaScript files at the position they are placed in your JSF view template. In accordance
with the recommendations of the Yahoo Performance Guildlines, these two tags should be placed in the head
section of any page that uses the Spring Faces components. For example:
@@ -163,48 +177,89 @@
- Configuring Web Flow to render JSF views
+ Configuring Web Flow for use with JSF
- The next step is to configure Web Flow to render JSF views. To do this, in your Spring Web Flow
- configuration include the
- faces
- namespace and link in the
- flow-builder-services element from the faces custom namespace.
- :
+ This section explains how to configure Web Flow with JSF.
+ The next section provides more details specific to using Web Flow with JSF 2.
+ The following is sample configuration for Web Flow and JSF:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]]>
+
+
+ The main points are the installation of a FlowFacesContextLifecycleListener that
+ manages a single FacesContext for the duration of Web Flow request and the
+ use of the flow-builder-services element from the faces custom
+ namespace to configure rendering for a JSF environment.
+
+
+ See the swf-booking-faces reference application in the distribution for a complete working example.
+
+
+
+ Configuring Spring MVC for use with JSF 2
+
+ In a JSF 2 environment you'll also need this Spring MVC related configuration:
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
]]>
- The faces:flow-builder-services tag also configures several other defaults appropriate for a JSF environment.
+ The resources custom namespace element delegates JSF 2 resource
+ requests to the JSF 2 resource API. The JsfFlowHandlerAdapter
+ is a replacement for the FlowHandlerAdapter normally used with
+ Web Flow. This adapter initializes itself with a JsfAjaxHandler instead
+ of the SpringJavaSciprtAjaxHandler previously used with Spring
+ Faces components.
-
- See the swf-booking-faces reference application in the distribution for a complete working example.
-
Configuring faces-config.xml
@@ -626,6 +681,118 @@
+
+ Using the Spring Security Facelets Tag Library
+
+ To use the library you'll need to create a .taglib.xml file and register it in web.xml.
+ Unfortunately Spring Web Flow cannot easily do this automatically without causing issues for
+ either JSF 2 or JSF 1.2 users. In a future release we will consider splitting the security tag
+ library into a separate artifact with JSF 1.2 and 2.0 versions to make the library easier to add.
+
+
+ Note: all instructions you will see in this section assume you already know how
+ to configure Spring Security itself.
+
+
+ For JSF 2 save the following as /WEB-INF/springsecurity.taglib.xml:
+
+
+
+
+ http://www.springframework.org/security/tags
+
+ authorize
+ org.springframework.faces.security.FaceletsAuthorizeTagHandler
+
+
+ areAllGranted
+ org.springframework.faces.security.FaceletsAuthorizeTagUtils
+ boolean areAllGranted(java.lang.String)
+
+
+ areAnyGranted
+ org.springframework.faces.security.FaceletsAuthorizeTagUtils
+ boolean areAnyGranted(java.lang.String)
+
+
+ areNotGranted
+ org.springframework.faces.security.FaceletsAuthorizeTagUtils
+ boolean areNotGranted(java.lang.String)
+
+
+ isAllowed
+ org.springframework.faces.security.FaceletsAuthorizeTagUtils
+ boolean isAllowed(java.lang.String, java.lang.String)
+
+
+]]>
+
+ For JSF 1.2 use the same content as shown above but replace FaceletsAuthorizeTagHandler with
+ Jsf12FaceletsAuthorizeTagHandler and FaceletsAuthorizeTagUtils wiht
+ Jsf12FaceletsAuthorizeTagUtils.
+
+
+ Register the above file in web.xml:
+
+
+ javax.faces.FACELETS_LIBRARIES
+ /WEB-INF/springsecurity.taglib.xml
+
+]]>
+
+ Now you are ready to use the tag library in your views.
+ You can use the authorize tag to include nested content conditionally:
+
+
+
+
+
+ Lorem ipsum dolor sit amet
+
+
+
+ Lorem ipsum dolor sit amet
+
+
+
+ Lorem ipsum dolor sit amet
+
+
+
+]]>
+
+
+ You can also use one of several EL functions in the rendered or other
+ attribute of any JSF component:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]]>
+
+
Enhancing The User Experience With Rich Web Forms
diff --git a/spring-webflow-reference/src/whatsnew.xml b/spring-webflow-reference/src/whatsnew.xml
index f542184b..b5752319 100644
--- a/spring-webflow-reference/src/whatsnew.xml
+++ b/spring-webflow-reference/src/whatsnew.xml
@@ -2,105 +2,122 @@
- What's New In Spring Web Flow 2.1
+ What's New In Spring Web Flow 2.2.0
+
+ 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 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:
+
+
+
+
+
+
+ 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 for more details.
+
+
- Version Upgrades
+ Spring JavaScript Updates
- Spring Version Changes
+ Deprecated ResourcesServlet
- Spring Web Flow 2.1 is built on Spring 3 that in turn requires Java 5.
+ 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.
- Spring Security Version Changes
+ Dojo 1.5 and dojox
- Spring Web Flow 2.1 is built on Spring Security 3.
- Due to package changes in Spring Security this release is not backwards compatible with prior versions of Spring Security.
+ 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.
- Tiles Version Changes
+ Two Spring JS artifacts
- Spring Web Flow 2.1 is built on Spring 3, which in turn requires Tiles 2.1.2 (or higher).
- Due to incompatible API changes in Tiles 2.1.2 this release is not backwards compatible with prior versions of Tiles.
+ 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.
- JSF Version Changes
+ Client resources moved into META-INF/web-resources
- Spring Web Flow 2.1 provides initial support for JSF 2 and aims to maintains backwards compatibility with JSF 1.2 while JSF 1.1 will no longer be officially targeted.
-
-
- Initial support for JSF 2 means the ability use Mojarra or Apache MyFaces JSF 2 dependencies along with the Faceletes implementation officially bundled with JSF 2 jars.
- That means any separate Facelets libraries such as com.sun.facelets (the one containing com.sun.facelets.FaceletViewHandler) can be removed from the project dependencies.
- Please see the booking-faces Web Flow sample, which is configured to run with Mojarra 2.0.
- The ivy.xml included in the sample has configuration and notes on how to recompile for Mojarra 1.2 or with Apache MyFaces.
- The recommended version of Apache MyFaces 2 to use is 2.0.1.SNAPSHOT due to MYFACES-2686.
-
-
- Partial state saving is a new feature that is enabled by default in JSF 2.
- This feature is not yet supported in Spring Web Flow and must be disabled through a servlet configuration parameter as is shown the booking-faces sample.
-
-
- In version 2.1 Spring Web Flow doesn't explicitly target any JSF 2 features.
- Some features such as composite components, JSR 303 validation, and others may work while others such as the new Ajax support probably won't.
- The goal of this release is to be an intermediate step with more meaningful JSF 2 support to follow in subsequent releases.
-
-
- What this does is it allows applications to begin the migration to JSF 2 (if they wish to do so) and the Web Flow to team to work and test effectively in a JSF 2 environment.
-
-
-
- Portlet Version Changes
-
- Spring Web Flow 2.1 is built on Spring 3, which in turn requires Portlet API 2.0.
- There are no significant changes in Web Flow relating to this upgrade.
- The programming model for Spring Portlet MVC applications is mostly backwards compatible with applications running on Portlet API 1.0.
- The implications of this change are mostly with regards to runtime version requirements.
-
-
- The booking-portlet-mvc sample has been tested with Apache Pluto 2.0.1 with a nightly build update due to PLUTO-591.
- Apache Pluto 2.0.2 or higher will give you that fix.
-
-
- The booking-portlet-faces sample unfortunately has not been tested successfully with the combination of JSF 1.2, Portlet 2.0, and Facelets.
- See the readme in the sample for more information.
+ 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.
-
- Spring 3 Changes
+
+ JFS Portlet Support
- Spring EL
+ Portlet API 2.0 and JSF 1.2 support
- The Spring Expression language is now the default implementation used in Spring Web Flow.
- Existing applications can still choose to plug in the Unified EL or OGNL if they wish to do so.
- Spring EL however is the recommended approach.
- It offers advantages such as close integration with the Spring 3 Type Conversion and Formatting system and is also used in other Spring projects.
- For more information see .
+ 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.
-
- Spring 3 Type Conversion
-
- Spring Web Flow now uses the new Spring 3 type conversion and formatting mechanism that includes use of formatting annotations such as NumberFormat and DateTimeFormat.
- The Spring 3 type conversion was influenced by the existing mechanism used in Spring Web Flow.
- Hence Web Flow users should find this to be a logical step forward.
-
-
- Existing applications can continue to use the custom converters they currently have.
- With the new approach however, they can now use a single mechanism across Spring MVC controllers and flow definitions.
- For more information see .
-
-
-
-
- Tiles Updates
-
- Spring Web Flow 2.1 provides support for Tiles 2.1.2.
- It has contains important features that can help reduce Tiles related configuration.
- This includes wildcard support when listing Tiles definition files or when defining Tiles definitions, anonymous and cascaded nested definitions among others.
- See What's new in Tiles 2.1 for more details.
-
-
+
diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/springsecurity.taglib.xml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/springsecurity.taglib.xml
index 66652c00..ea37d89f 100644
--- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/springsecurity.taglib.xml
+++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/springsecurity.taglib.xml
@@ -23,4 +23,9 @@
org.springframework.faces.security.FaceletsAuthorizeTagUtils
boolean areNotGranted(java.lang.String)
+
+ isAllowed
+ org.springframework.faces.security.FaceletsAuthorizeTagUtils
+ boolean isAllowed(java.lang.String, java.lang.String)
+
\ No newline at end of file
diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/web.xml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/web.xml
index 780b2d1b..d9678838 100755
--- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/web.xml
+++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/web.xml
@@ -32,12 +32,11 @@
-
javax.faces.PARTIAL_STATE_SAVING
false
+ -->
diff --git a/spring-webflow-samples/booking-portlet-faces/src/main/webapp/WEB-INF/web.xml b/spring-webflow-samples/booking-portlet-faces/src/main/webapp/WEB-INF/web.xml
index 190391ba..1ad56826 100644
--- a/spring-webflow-samples/booking-portlet-faces/src/main/webapp/WEB-INF/web.xml
+++ b/spring-webflow-samples/booking-portlet-faces/src/main/webapp/WEB-INF/web.xml
@@ -32,20 +32,6 @@
org.springframework.web.context.ContextLoaderListener
-
-
-
- Resources Servlet
- org.springframework.js.resource.ResourceServlet
- 0
-
-
-
-
- Resources Servlet
- /resources/*
-
-