<!-- A listener to create and release a FacesContext -->
<beans:bean id="facesContextListener"
class="org.springframework.faces.webflow.FlowFacesContextLifecycleListener"/>
</beans:beans>
In Listing 18-3, the webflow-config-namespace is declared as the default namespace. Also, the faces
namespace is defined for JSF-related configurations.
First, the <flow-executor> tag defines an instance of the
org.springframework.webflow.executor.FlowExecutor interface, which is the central façade and entry-
point service interface into the Spring Web Flow system for driving the executions of flow definitions.
Second, the <flow-registry> tag defines a registry for the flow definitions within the application.
From the listing, the flow definitions are stored in files named flow.xml, under the parent folder /WEB-
INF/flows. For example, the file /WEB-INF/flows/contacts/flow.xml will store the flow definition for the
contact application.
The <faces:flow-builder-services> tag defines an instance of the
org.springframework.webflow.engine.builder.support.FlowBuilderServices class, with JSF integration,
which is required for Spring Web Flow when building the flows within the flow registry.
Finally, the bean with an ID of facesContextListener and the implementation class
FlowFacesContextLifecycleListener defines an instance of the
org.springframework.webflow.execution.FlowExecutionListener interface, which creates an instance of
the org.springframework.faces.webflow.FlowFacesContext class. The FlowFacesContext class extends
JSF's FacesContext abstract class (under the package javax.faces.context), which provides the context
for the underlying JSF 2 runtime environment.
Listing 18-4 shows the Spring MVC DispatcherServlet WebApplicationContext (/WEB-
INF/spring/appServlet/servlet-context.xml.
Listing 18-4. Spring MVC Configuration File
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:faces="http://www.springframework.org/schema/faces"
xsi:schemaLocation="http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/faces
http://www.springframework.org/schema/faces/spring-faces.xsd">
<beans:import resource="webflow.xml" />
<annotation-driven />
<resources location="/" mapping="/resources/**"/>
<faces:resources/>
Search WWH :
Custom Search
Previous Page
Spring Framework 3 Topic Index
Next Page
Spring Framework 3 Bookmarks
Home