diff --git a/spring-webflow-reference/src/spring-faces.xml b/spring-webflow-reference/src/spring-faces.xml
index 91007909..4c16f640 100644
--- a/spring-webflow-reference/src/spring-faces.xml
+++ b/spring-webflow-reference/src/spring-faces.xml
@@ -4,20 +4,21 @@
Introduction
- Spring Faces is Spring's JSF integration module that simplifies using JSF with Spring.
- It lets you use the JSF UI Component Model with Spring MVC and Spring Web Flow controllers.
+ Spring Faces is Spring's JSF integration module that simplifies using JSF with Spring. It lets you use the
+ JSF UI Component Model with Spring MVC and Spring Web Flow controllers.
- Spring Faces also includes a small Facelets component library that provides Ajax and client-side validation capabilities.
- This component library builds on Spring Javascript, a Javascript abstraction framework that integrates Dojo as the underlying UI toolkit.
+ Spring Faces also includes a small Facelets component library that provides Ajax and client-side validation
+ capabilities. This component library builds on Spring Javascript, a Javascript abstraction framework that
+ integrates Dojo as the underlying UI toolkit.
Spring-centric Integration Approach
- Spring Faces combines the strengths of JSF, its UI component model, with the strengths of Spring, its controller and configuration model.
- This brings you all the strengths of JSF without any of the weaknesses.
+ Spring Faces combines the strengths of JSF, its UI component model, with the strengths of Spring, its
+ controller and configuration model. This brings you all the strengths of JSF without any of the weaknesses.
Spring Faces provides a powerful supplement to a number of the standard JSF facilities, including:
@@ -33,15 +34,119 @@
Ajax partial page updates and full navigationprogressive enhancement and graceful degradation
-
+
Using these features will significantly reduce the amount of configuration required in faces-config.xml
while providing a cleaner separation between the view and controller layer and better modularization of your
application's functional responsibilities. These use of these features are outlined in the sections to
follow. As the majority of these features build on the flow definition language of Spring Web Flow, it is
assumed that you have an understanding of the foundations presented in
- Defining Flows.
+ Defining Flows
+ .
+
+ Configuring web.xml
+
+ The first step to using Spring Faces is to route requests to the
+ DispatcherServlet
+ in the
+ web.xml
+ file. In this example, we map all URLs that begin with
+ /spring/
+ to the servlet. The servlet needs to be configured. An
+ init-param
+ is used in the servlet to pass the
+ contextConfigLocation
+ . This is the location of the Spring configuration for your application.
+
+
+ Spring MVC Dispatcher Servlet
+ org.springframework.web.servlet.DispatcherServlet
+
+ contextConfigLocation
+ /WEB-INF/web-application-config.xml
+
+ 1
+
+
+
+ Spring MVC Dispatcher Servlet
+ /spring/*
+]]>
+
+
+ In order for JSF to bootstrap correctly, the
+ FacesServlet
+ must be configured in
+ web.xml
+ as it normally would even though you generally will not need to route requests through it at all when using
+ Spring Faces.
+
+
+
+ Faces Servlet
+ javax.faces.webapp.FacesServlet
+ 1
+
+
+
+
+ Faces Servlet
+ *.faces
+]]>
+
+
+ When using the Spring Faces components, you also need to configure the Spring JavaScript
+ ResourceServlet
+ so that CSS and JavaScript resources may be output correctly by the components. This servlet must be mapped
+ to /resources/* in order for the URL's rendered by the components to function correctly.
+
+
+
+ Resources Servlet
+ org.springframework.js.resource.ResourceServlet
+ 0
+
+
+
+
+ Resources Servlet
+ /resources/*
+]]>
+
+
+ The Spring Faces components require the use of Facelets instead of JSP, so the typical Facelets
+ configuration must be added as well when using these components.
+
+
+
+ javax.faces.DEFAULT_SUFFIX
+ .xhtml
+]]>
+
+
+
+ Configuring faces-config.xml
+
+ The only configuration needed in
+ faces-config.xml
+ is specific to the use of Facelets. If you are using JSP and not using the Spring Faces components, you do
+ not need to add anything specific to Spring Faces to your
+ faces-config.xml
+
+
+
+
+ com.sun.facelets.FaceletViewHandler
+
+]]>
+
+ Replacing the JSF Managed Bean Facility
@@ -382,6 +487,98 @@
component that will raise a JSF action even in response to any client-side DOM event. See the Spring
Faces tag library docs for full details.
+
+ An additional built-in feature when using the Spring Faces Ajax components is the ability to have the
+ response rendered inside a rich modal popup widget by setting
+ popup="true"
+ on a
+ view-state
+ .
+
+
+
+
+
+
+
+
+]]>
+
+
+ If the "changeSearchCriteria"
+ view-state
+ is reached as the result of an Ajax-request, the result will be rendered into a rich popup. If
+ JavaScript is unavailable, the request will be processed with a full browser refresh, and the
+ "changeSearchCriteria" view will be rendered as normal.
+
+
+
+
+ Enhancing The User Experience With Rich Web Forms
+
+ JSF and Web Flow combine to provide and extensive server-side validation model for your web application, but
+ excessive roundtrips to the server to execute this validation and return error messages can be a tedious
+ experience for your users. Spring Faces provides a number of client-side rich validation controls that can
+ enhance the user experience by applying simple validations that give immediate feedback. Some simple
+ examples are illustrated below. See the Spring Faces taglib docs for a complete tag reference.
+
+
+ Validating a Text Field
+
+ Simple client-side text validation can be applied with the
+ clientTextValidator
+ component:
+
+
+
+]]>
+
+
+ This will apply client-side required validation to the child
+ inputText
+ component, giving the user a clear indicator if the field is left blank.
+
+
+
+ Validating a Numeric Field
+
+ Simple client-side numeric validation can be applied with the
+ clientNumberValidator
+ component:
+
+
+
+]]>
+
+
+ This will apply client-side validation to the child
+ inputText
+ component, giving the user a clear indicator if the field is left blank, is not numeric, or does not
+ match the given regular expression.
+
+
+
+ Validating a Date Field
+
+ Simple client-side date validation with a rich calendar popup can be applied with the
+ clientDateValidator
+ component:
+
+
+
+
+
+]]>
+
+
+ This will apply client-side validation to the child
+ inputText
+ component, giving the user a clear indicator if the field is left blank or is not a valid date.
+