javax.faces.PROJECT_STAGE parameter defines the project stage. The value of Development causes more
output messages to be displayed to the web browser to facilitate troubleshooting. In production, the
value Production should be used. The parameter javax.faces.FACELETS_REFRESH_PERIOD defines the
interval in seconds for the Facelets compiler to check for changes made to the page template. Setting the
value to 1 means the change will be checked every second, so when we make frequent changes to the
page templates during development, each change can be detected immediately. In the production
environment, set the value to -1 so that all compiled templates will not be checked for changes.
Second, a servlet with class javax.faces.webapp.FacesServlet is declared. The servlet is used only to
bootstrap the JSF environment.
You will also see the definition of a DispatcherServlet for the contact application that was mapped
to the URL pattern /app/*. Since Spring Web Flow tightly integrates with Spring MVC, we use the
DispatcherServlet to dispatch the request to the underlying Spring Web Flow executor for request
processing.
Configuring Spring Web Flow and Spring MVC
The final step in configuration relates to Spring Web Flow and Spring MVC. For Spring Web Flow, we will
prepare an individual configuration file. When using Spring MVC, the configuration file usually resides
in the same folder as the DispatcherServlet configuration file. Listing 18-3 shows the configuration file
(/WEB-INF/spring/appServlet/webflow.xml).
Listing 18-3. Spring Web Flow Configuration File
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/webflow-config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:faces="http://www.springframework.org/schema/faces"
xsi:schemaLocation="http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/faces
http://www.springframework.org/schema/faces/spring-faces-2.0.xsd">
<!-- Executes flows: the central entry point into the Spring Web Flow system -->
<flow-executor id="flowExecutor">
<flow-execution-listeners>
<listener ref="facesContextListener"/>
</flow-execution-listeners>
</flow-executor>
<!-- The registry of executable flow definitions -->
<flow-registry id="flowRegistry"
flow-builder-services="flowBuilderServices"
base-path="/WEB-INF/flows">
<flow-location-pattern value="/**/flow.xml" />
</flow-registry>
<!-- Configures the Spring Web Flow JSF integration -->
<faces:flow-builder-services id="flowBuilderServices"/>
Search WWH :
Custom Search
Previous Page
Spring Framework 3 Topic Index
Next Page
Spring Framework 3 Bookmarks
Home