diff --git a/spring-webflow-reference/src/flow-managed-persistence.xml b/spring-webflow-reference/src/flow-managed-persistence.xml
new file mode 100644
index 00000000..a493fc09
--- /dev/null
+++ b/spring-webflow-reference/src/flow-managed-persistence.xml
@@ -0,0 +1,10 @@
+
+
+ Flow Managed Persistence
+
+ Introduction
+
+ This chapter shows you how to use flows to manage web application persistence.
+
+
+
\ No newline at end of file
diff --git a/spring-webflow-reference/src/flow-security.xml b/spring-webflow-reference/src/flow-security.xml
index cc0b61aa..f8b8d0a2 100644
--- a/spring-webflow-reference/src/flow-security.xml
+++ b/spring-webflow-reference/src/flow-security.xml
@@ -76,14 +76,12 @@
<webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry">
- <webflow:flow-execution-listeners>
- <webflow:listener ref="securityFlowExecutionListener" />
- ...
- </webflow:flow-execution-listeners>
+ <webflow:flow-execution-listeners>
+ <webflow:listener ref="securityFlowExecutionListener" />
+ </webflow:flow-execution-listeners>
</webflow:flow-executor>
-<bean id="securityFlowExecutionListener"
- class="org.springframework.webflow.security.SecurityFlowExecutionListener" />
+<bean id="securityFlowExecutionListener" class="org.springframework.webflow.security.SecurityFlowExecutionListener" />
If your application is using authorities that are not role based, you will need to configure a custom AccessDecisionManager.
@@ -91,9 +89,8 @@
Please consult the Spring Security documentation to learn more about decision managers.
-<bean id="securityFlowExecutionListener"
- class="org.springframework.webflow.security.SecurityFlowExecutionListener">
- <property name="accessDecisionManager" ref="myCustomAccessDecisionManager" />
+<bean id="securityFlowExecutionListener" class="org.springframework.webflow.security.SecurityFlowExecutionListener">
+ <property name="accessDecisionManager" ref="myCustomAccessDecisionManager" />
</bean>
@@ -120,42 +117,26 @@
<security:http auto-config="true">
- <!-- restrict URLs based on role -->
- <security:intercept-url pattern="/spring/login*" access="ROLE_ANONYMOUS" />
- <security:intercept-url pattern="/spring/logout-success*" access="ROLE_ANONYMOUS" />
- <security:intercept-url pattern="/spring/logout*" access="ROLE_USER" />
-
- <!-- override default login and logout pages -->
- <security:form-login login-page="/spring/login"
- login-url="/spring/login-process"
- default-target-url="/spring/main"
- authentication-failure-url="/spring/login?login_error=1" />
- <security:logout logout-url="/spring/logout"
- logout-success-url="/spring/logout-success" />
+ <security:intercept-url pattern="/spring/login*" access="ROLE_ANONYMOUS" />
+ <security:intercept-url pattern="/spring/logout-success*" access="ROLE_ANONYMOUS" />
+ <security:intercept-url pattern="/spring/logout*" access="ROLE_USER" />
+
+ <security:form-login login-page="/spring/login"
+ login-url="/spring/login-process"
+ default-target-url="/spring/main"
+ authentication-failure-url="/spring/login?login_error=1" />
+
+ <security:logout logout-url="/spring/logout" logout-success-url="/spring/logout-success" />
</security:http>
-<!--
- Define local authentication provider, a real app would use an
- external provider (JDBC, LDAP, CAS, etc)
-
- usernames/passwords are:
- keith/melbourne
- erwin/leuven
- jeremy/atlanta
- scott/rochester
--->
<security:authentication-provider>
- <security:password-encoder hash="md5" />
- <security:user-service>
- <security:user name="keith" password="417c7382b16c395bc25b5da1398cf076"
- authorities="ROLE_USER, ROLE_SUPERVISOR" />
- <security:user name="erwin" password="12430911a8af075c6f41c6976af22b09"
- authorities="ROLE_USER, ROLE_SUPERVISOR" />
- <security:user name="jeremy" password="57c6cbff0d421449be820763f03139eb"
- authorities="ROLE_USER" />
- <security:user name="scott" password="942f2339bf50796de535a384f0d1af3e"
- authorities="ROLE_USER" />
- </security:user-service>
+ <security:password-encoder hash="md5" />
+ <security:user-service>
+ <security:user name="keith" password="417c7382b16c395bc25b5da1398cf076" authorities="ROLE_USER,ROLE_SUPERVISOR" />
+ <security:user name="erwin" password="12430911a8af075c6f41c6976af22b09" authorities="ROLE_USER,ROLE_SUPERVISOR" />
+ <security:user name="jeremy" password="57c6cbff0d421449be820763f03139eb" authorities="ROLE_USER" />
+ <security:user name="scott" password="942f2339bf50796de535a384f0d1af3e" authorities="ROLE_USER" />
+ </security:user-service>
</security:authentication-provider>
diff --git a/spring-webflow-reference/src/portlet.xml b/spring-webflow-reference/src/portlet.xml
new file mode 100644
index 00000000..8bb874b9
--- /dev/null
+++ b/spring-webflow-reference/src/portlet.xml
@@ -0,0 +1,10 @@
+
+
+ Portlet Integration
+
+ Introduction
+
+ This chapter shows you how to use Web Flow in a Portlet environment.
+
+
+
\ No newline at end of file
diff --git a/spring-webflow-reference/src/spring-faces.xml b/spring-webflow-reference/src/spring-faces.xml
index a4c42a7f..91007909 100644
--- a/spring-webflow-reference/src/spring-faces.xml
+++ b/spring-webflow-reference/src/spring-faces.xml
@@ -1,7 +1,6 @@
- Using Spring Faces
-
+ JSF Integration
Introduction
@@ -114,7 +113,7 @@
managed beans are typically allocated.
-
+
Manipulating The Model
The need to initialize the model before view rendering (such as by loading persistent entities from a
diff --git a/spring-webflow-reference/src/spring-mvc.xml b/spring-webflow-reference/src/spring-mvc.xml
new file mode 100644
index 00000000..972cb762
--- /dev/null
+++ b/spring-webflow-reference/src/spring-mvc.xml
@@ -0,0 +1,10 @@
+
+
+ Spring MVC Integration
+
+ Introduction
+
+ This chapter shows you how to integrate Web Flow into a Spring MVC web application.
+
+
+
\ No newline at end of file
diff --git a/spring-webflow-reference/src/spring-webflow-reference.xml b/spring-webflow-reference/src/spring-webflow-reference.xml
index e7ca8d38..59c665f3 100644
--- a/spring-webflow-reference/src/spring-webflow-reference.xml
+++ b/spring-webflow-reference/src/spring-webflow-reference.xml
@@ -6,9 +6,13 @@
+
+
+
+
]>
@@ -73,9 +77,13 @@
&defining-flows;
⪙
&views;
+ &flow-managed-persistence;
&flow-security;
&flow-inheritance;
+ &system-setup;
+ &spring-mvc;
&spring-faces;
+ &portlet;
&upgrade-guide;
&flow-definition-field-mappings;
diff --git a/spring-webflow-reference/src/system-setup.xml b/spring-webflow-reference/src/system-setup.xml
index ca9de59b..c7ac7d9c 100644
--- a/spring-webflow-reference/src/system-setup.xml
+++ b/spring-webflow-reference/src/system-setup.xml
@@ -7,4 +7,217 @@
This chapter shows you how to setup the Web Flow system for use in any web environment.
+
+ webflow-config.xsd
+
+ Web Flow provides a Spring schema that allows you to configure the system.
+ To use this schema, include it in one of your infrastructure-layer beans files:
+
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:webflow="http://www.springframework.org/schema/webflow-config"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://www.springframework.org/schema/webflow-config
+ http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd">
+
+ <!-- Setup Web Flow here -->
+
+</beans>
+
+
+
+ Basic system configuration
+
+ The next section shows the minimal configuration required to set up the Web Flow system in your application.
+
+
+ FlowRegistry
+
+ Register your flows in a FlowRegistry:
+
+
+<webflow:flow-registry id="flowRegistry">
+ <webflow:flow-location path="/WEB-INF/flows/booking/booking.xml" />
+</webflow:flow-registry>
+
+
+
+ FlowExecutor
+
+ Deploy a FlowExecutor, the central service for executing flows:
+
+
+<webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry" />
+
+
+
+ See the Spring MVC and Spring Faces sections of this guide on how to integrate the Web Flow system with the MVC and JSF environment, respectively.
+
+
+
+ flow-registry options
+
+ Configuring custom FlowBuilder services
+
+ Use the flow-builder-services attribute to customize the services used to build the flows in a registry.
+ If no flow-builder-services tag is specified, the default service implementations are used.
+ When the tag is defined, you only need to reference the services you want to customize.
+
+
+<webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices">
+ <webflow:flow-location path="/WEB-INF/flows/booking/booking.xml" />
+</webflow:flow-registry>
+
+<webflow:flow-builder-services id="flowBuilderServices" />
+
+
+ The configurable services are the conversion-service, formatter-registry, expression-parser, and view-factory-creator.
+ These services are configured by referencing custom beans you define. For example:
+
+
+<webflow:flow-builder-services id="flowBuilderServices"
+ conversion-service="conversionService"
+ formatter-registry="formatterRegistry"
+ expression-parser="expressionParser"
+ view-factory-creator="viewFactoryCreator"/>
+
+<bean id="conversionService" class="..." />
+<bean id="formatterRegistry" class="..." />
+<bean id="expressionParser" class="..." />
+<bean id="viewFactoryCreator" class="..." />
+
+
+ conversion-service
+
+ Use the conversion-service attribute to customize the ConversionService used by the Web Flow system.
+ Converters are used to convert from one type to another when required during flow execution.
+ The default ConversionService registers converters for your basic object types such as numbers, classes, and enums.
+
+
+
+ formatter-registry
+
+ Use the formatter-registry attribute to customize the FormatterRegistry used by the Web Flow system.
+ Formatters are used by Views to format model property values for display.
+ The default FormatterRegistry registers converters for your basic model object types such as numbers and dates.
+
+
+
+ expression-parser
+
+ Use the expression-parser attribute to customize the ExpressionParser used by the Web Flow system.
+ The default ExpressionParser uses the Unified EL if available on the classpath, otherwise OGNL is used.
+
+
+
+ view-factory-creator
+
+ Use the view-factory-creator attribute to customize the ViewFactoryCreator used by the Web Flow system.
+ The default ViewFactoryCreator produces Spring MVC ViewFactories capable of rendering JSP, Velocity, and Freemarker views.
+
+
+
+
+ Configuring FlowRegistry hierarchies
+
+ Use the parent attribute to link two flow registries together in a hierarchy.
+ When the child registry is queried, if it cannot find the requested flow it will delegate to its parent.
+
+
+<!-- my-system-config.xml -->
+<webflow:flow-registry id="flowRegistry" parent="sharedFlowRegistry">
+ <webflow:flow-location path="/WEB-INF/flows/booking/booking.xml" />
+</webflow:flow-registry>
+
+<!-- shared-config.xml -->
+<webflow:flow-registry id="sharedFlowRegistry">
+ <-- Global flows shared by several applications --<
+</webflow:flow-registry>
+
+
+
+ Specifying flow locations
+
+ Use the location element to specify paths to flow definitions to register.
+ By default, flows will be assigned registry identifiers equal to their filenames minus the file extension.
+
+
+<webflow:flow-location path="/WEB-INF/flows/booking/booking.xml" />
+
+
+
+ Assigning custom flow identifiers
+
+ Specify an id to assign a custom registry identifier to a flow:
+
+
+<webflow:flow-location path="/WEB-INF/flows/booking/booking.xml" id="bookHotel" />
+
+
+
+ Assigning flow meta-attributes
+
+ Use the flow-definition-attributes element to assign custom meta-attributes to a registered flow:
+
+
+<webflow:flow-location path="/WEB-INF/flows/booking/booking.xml">
+ <flow-definition-attributes>
+ <attribute name="caption" value="Books a hotel" />
+ <attribute name="persistence-context" value="true" type="boolean" />
+ </flow-definition-attributes>
+</webflow:flow-location>
+
+
+
+
+ flow-executor options
+
+ Attaching flow execution listeners
+
+ Use the flow-execution-listeners element to register listeners that observe the lifecycle of flow executions:
+
+
+<flow-execution-listeners>
+ <listener ref="securityListener"/>
+ <listener ref="persistenceListener"/>
+</flow-execution-listeners>
+
+
+ You may also configure a listener to observe only certain flows:
+
+
+<listener ref="securityListener" criteria="securedFlow1,securedFlow2"/>
+
+
+
+ Tuning FlowExecution persistence
+
+ Use the flow-execution-repository element to tune flow execution persistence settings:
+
+
+<flow-execution-repository max-conversations="5" max-snapshots="30" />
+
+
+ max-conversations
+
+ Tune the max-conversations attribute to place a cap on the number of conversations that can be created per user session.
+
+
+
+ max-snapshots
+
+ Tune the max-snapshots attribute to place a cap on the number of flow execution snapshots that can be taken per conversation.
+
+
+
+ conversation-manager
+
+ Set a custom ConversationManager to completely customize where conversational flow state is persisted.
+
+
+
+
\ No newline at end of file
diff --git a/spring-webflow-reference/src/views.xml b/spring-webflow-reference/src/views.xml
index 41176ade..ac025c42 100644
--- a/spring-webflow-reference/src/views.xml
+++ b/spring-webflow-reference/src/views.xml
@@ -8,7 +8,7 @@
- view-state
+ Defining view states
Use the view-state element to define a step of the flow that renders a view and waits for a user event to resume:
@@ -38,7 +38,7 @@
- Explicit view ids
+ Specifying view identifiers
Use the view attribute to explictly specify the id of the view to render.
@@ -74,7 +74,7 @@
- viewScope
+ View scope
A view-state allocates a new viewScope when it enters.
This scope may be referenced within the view-state to assign variables that should live for the duration of the state.
@@ -103,7 +103,7 @@
- Manipulating objects view scope
+ Manipulating objects in view scope
Objects in view scope are often manipulated over a series of requests from the same view.
The following example illustrates paginiation through a search results list.
@@ -128,7 +128,7 @@
- on-render
+ Executing render actions
Use the on-render element to execute one or more actions before view rendering.
Render actions are executed on the initial render as well as any subsequent refreshes, including any partial re-renderings of the view.
@@ -140,7 +140,7 @@
- Model binding
+ Binding to a model
Use the model attribute to declare a model object the view binds to.
This attribute is typically used with views that render data controls, such as forms.
@@ -168,7 +168,7 @@
- bind
+ Suppressing binding
Use the bind attribute to suppress model binding and validation for particular view events.
@@ -180,7 +180,7 @@
- Validation
+ Validating a model
Model validation is driven by constraints specified against the model object.
These constraints may be specified declaratively, or enforced using a programmatic validation routine or external Validator.
@@ -240,7 +240,7 @@ public class BookingValidator {
- Event handlers
+ Handling events
From a view-state, transitions without targets can also be defined. Such transitions are called "event handlers":
@@ -254,7 +254,7 @@ public class BookingValidator {
They simply execute their actions and re-render the current view or one or more fragments of the current view.
- Partial re-rendering
+ Rendering partials
Use the render element to request partial re-rendering of a view after handling an event:
@@ -274,7 +274,7 @@ public class BookingValidator {
- Messages
+ Working with messages
Spring Web Flow's MessageContext is an API for recording messages during the course of flow executions.
Plain text messages can be added to the context, as well as internationalized messages resolved by a Spring MessageSource.
@@ -303,7 +303,7 @@ context.addMessage(builder.info().code("reservationConfirmation").build());
- Flow message bundles
+ Using message bundles
Internationalized messages are defined in message bundles accessed by a Spring MessageSource.
To create a flow-specific message bundle, simply define messages.properties file(s) in your flow's directory.
@@ -318,7 +318,7 @@ reservationConfirmation=We have processed your reservation - thank you and enjoy