This commit is contained in:
Keith Donald
2008-03-08 04:39:33 +00:00
parent f8f25ab7de
commit 1952fdea46
54 changed files with 626 additions and 257 deletions

View File

@@ -29,7 +29,7 @@
<li>Spring IDE tooling integration, with support for graphical flow modeling and visualization</li>
</ul>
<p align="right">
<a href="flows/main">Start your Spring Travel experience</a>
<a href="main">Start your Spring Travel experience</a>
</p>
</div>

View File

@@ -23,19 +23,29 @@
<!-- Activates annotation-based bean configuration -->
<context:annotation-config />
<!-- Instructs Spring to perfrom declarative transaction managemenet on annotated classes -->
<tx:annotation-driven />
<!-- Scans for application components to deploy -->
<!-- Scans for application @Components to deploy -->
<context:component-scan base-package="org.springframework.webflow.samples.booking" />
<!-- Handles requests to the Spring Web Flow system -->
<bean name="/flows/*" class="org.springframework.webflow.mvc.FlowController">
<!-- Maps request URIs to controllers -->
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<value>
/main=flowController
/booking=flowController
</value>
</property>
<property name="defaultHandler">
<!-- Handles requests mapped directly to facelet .xhtml view templates -->
<bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController" />
</property>
</bean>
<!-- Handles requests mapped to the Spring Web Flow system -->
<bean id="flowController" class="org.springframework.webflow.mvc.FlowController">
<constructor-arg ref="flowExecutor" />
</bean>
<bean name="/*" class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/>
<!-- Maps logical view names to Facelet templates (e.g. 'search' to '/WEB-INF/search.xhtml' -->
<bean id="jsfViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.faces.mvc.JsfView"/>
<property name="prefix" value="/WEB-INF/" />
@@ -54,7 +64,6 @@
<webflow:flow-registry id="flowRegistry" flow-builder-services="facesFlowBuilderServices">
<webflow:flow-location path="/WEB-INF/flows/main/main.xml" />
<webflow:flow-location path="/WEB-INF/flows/booking/booking.xml" />
<!-- TODO <webflow:flow-location path="/WEB-INF/flows/*/*.xml" /> -->
</webflow:flow-registry>
<!-- Configures the Spring Web Flow JSF integration -->
@@ -69,6 +78,9 @@
<!-- Installs a listener to apply Spring Security authorities -->
<bean id="securityFlowExecutionListener" class="org.springframework.webflow.security.SecurityFlowExecutionListener" />
<!-- Instructs Spring to perfrom declarative transaction managemenet on annotated classes -->
<tx:annotation-driven />
<!-- Drives transactions using local JPA APIs -->
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
@@ -120,5 +132,5 @@
<security:user name="scott" password="942f2339bf50796de535a384f0d1af3e" authorities="ROLE_USER" />
</security:user-service>
</security:authentication-provider>
</beans>

View File

@@ -6,21 +6,26 @@
<tiles:putAttribute name="content">
<div class="section">
<h1>Welcome to the Spring Web Flow + Spring MVC Sample Application</h1>
<h1>Welcome to Spring Travel</h1>
<p>
This reference application shows how to use Spring MVC and Web Flow together with JavaServerPages (JSP) and Tiles to develop web applications.
</p>
<p>
This hotel booking sample application illustrates Spring Web Flow in a Spring MVC environment.
The key features illustrated in this sample include:
</p>
<ul>
<li>A unified navigation model</li>
<li>A robust state management model</li>
<li>Modularization of web application functionality by domain responsibility</li>
<li>Flow-managed persistence contexts with the Java Persistence API (JPA)</li>
<li>OGNL Expression Language (EL) integration</li>
<li>Spring IDE integration, with support for graphical flow modeling</li>
<li>A declarative navigation model enabling full browser button support and dynamic navigation rules</li>
<li>A fine-grained state management model, including support for ConversationScope and ViewScope</li>
<li>Modularization of web application functionality by domain use case, illustrating project structure best-practices</li>
<li>Managed persistence contexts with the Java Persistence API (JPA)</li>
<li>Unified Expression Language (EL) integration</li>
<li>Spring Security integration</li>
<li>Applying reusable page layouts with Tiles</li>
<li>Exception handling support across all layers of the application</li>
<li>Spring IDE tooling integration, with support for graphical flow modeling and visualization</li>
</ul>
<p align="right">
<a href="main">Start your hotel booking experience</a>
<a href="main">Start your Spring Travel experience</a>
</p>
</div>

View File

@@ -14,41 +14,39 @@
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-2.0.xsd">
<bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<!-- Maps request URIs to controllers -->
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<value>
/intro=urlFilenameController
/login=urlFilenameController
/logout-success=urlFilenameController
/main=flowController
/booking=flowController
</value>
</property>
<property name="defaultHandler" ref="flowController" />
<property name="defaultHandler">
<!-- Handles requests mapped directly to facelet .xhtml view templates -->
<bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController" />
</property>
</bean>
<!-- Handles requests mapped to the Spring Web Flow system -->
<bean id="flowController" class="org.springframework.webflow.mvc.FlowController">
<constructor-arg ref="flowExecutor" />
</bean>
<!-- Executes flows: the central entry point into the Spring Web Flow system -->
<web:flow-executor id="flowExecutor" flow-registry="flowRegistry">
<web:flow-execution-listeners>
<web:listener ref="jpaFlowExecutionListener" criteria="*" />
<web:listener ref="securityFlowExecutionListener" criteria="*" />
</web:flow-execution-listeners>
</web:flow-executor>
<web:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices">
<!-- The registry of executable flow definitions -->
<web:flow-registry id="flowRegistry">
<web:flow-location path="WEB-INF/flows/main/main.xml" />
<web:flow-location path="WEB-INF/flows/booking/booking.xml" />
</web:flow-registry>
<web:flow-builder-services id="flowBuilderServices" expression-parser="expressionParser" />
<bean id="expressionParser" class="org.springframework.webflow.expression.el.WebFlowELExpressionParser">
<constructor-arg>
<bean class="org.jboss.el.ExpressionFactoryImpl" />
</constructor-arg>
</bean>
<!-- Installs a listener that manages JPA persistence contexts for flows that require them -->
<bean id="jpaFlowExecutionListener" class="org.springframework.webflow.persistence.JpaFlowExecutionListener">
<constructor-arg ref="entityManagerFactory" />
@@ -58,10 +56,7 @@
<!-- Installs a listener to apply Spring Security authorities -->
<bean id="securityFlowExecutionListener" class="org.springframework.webflow.security.SecurityFlowExecutionListener" />
<!-- Handles requests to render view templates directly: maps the requested path to a logical view name resolved by the resolver below -->
<bean id="urlFilenameController" class="org.springframework.web.servlet.mvc.UrlFilenameViewController" />
<!-- Maps logical view names selected by the url filename controller to .jsp view templates within the root webapp directory -->
<!-- Maps logical view names selected by the url filename controller to .jsp view templates within the /WEB-INF directory -->
<bean id="internalJspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/" />
<property name="suffix" value=".jsp" />
@@ -72,7 +67,7 @@
<property name="formObjectClass" value="org.springframework.webflow.samples.booking.SearchCriteria" />
</bean>
<!-- Handels form binding and validation for the hotel booking -->
<!-- Handels form binding and validation for the hotel booking process -->
<bean id="bookingActions" class="org.springframework.webflow.action.FormAction">
<property name="formObjectClass" value="org.springframework.webflow.samples.booking.Booking" />
<property name="propertyEditorRegistrar">
@@ -103,7 +98,7 @@
</bean>
<!-- Executes transactions around @Transactional methods -->
<tx:annotation-driven transaction-manager="transactionManager" />
<tx:annotation-driven />
<!-- Drives transactions using local JPA APIs -->
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">