[jboss-cvs] jboss-seam/examples/spring/resources/WEB-INF ...
Michael Youngstrom
youngm at gmail.com
Tue Jul 17 14:43:56 EDT 2007
User: myoungstrom
Date: 07/07/17 14:43:56
Added: examples/spring/resources/WEB-INF components.xml
web.xml faces-config.xml applicationContext.xml
pages.xml navigation.xml
Log:
JBSEAM-1568
Revision Changes Path
1.19 +8 -3 jboss-seam/examples/spring/resources/WEB-INF/components.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: components.xml
===================================================================
RCS file: components.xml
diff -N components.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ components.xml 17 Jul 2007 18:43:56 -0000 1.19
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:core="http://jboss.com/products/seam/core"
+ xmlns:persistence="http://jboss.com/products/seam/persistence"
+ xmlns:spring="http://jboss.com/products/seam/spring"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
+ http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
+ http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd
+ http://jboss.com/products/seam/spring http://jboss.com/products/seam/spring-2.0.xsd">
+
+
+ <core:manager conversation-timeout="120000"
+ concurrent-request-timeout="500"
+ conversation-id-parameter="cid"/>
+
+ <persistence:managed-persistence-context name="entityManager"
+ auto-create="true"
+ entity-manager-factory="#{entityManagerFactory}" />
+
+ <!-- Sample Hibernate Session -->
+ <persistence:managed-hibernate-session name="hibernateSession" auto-create="true" session-factory="#{sessionFactory}"/>
+
+ <core:init debug="true"/>
+
+ <spring:context-loader />
+
+ <!-- Install a ThreadPoolDispatcher to handle scheduled asynchronous event -->
+ <core:thread-pool-dispatcher name="threadPoolDispatcher"/>
+
+ <!-- Install the SpringDispatcher as default -->
+ <spring:task-executor-dispatcher schedule-dispatcher="#{threadPoolDispatcher}" task-executor="#{springThreadPoolTaskExecutor}"/>
+
+ <spring:spring-transaction platform-transaction-manager="#{transactionManager}"/>
+
+</components>
1.13 +1 -1 jboss-seam/examples/spring/resources/WEB-INF/web.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: web.xml
===================================================================
RCS file: web.xml
diff -N web.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ web.xml 17 Jul 2007 18:43:56 -0000 1.13
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <!-- Seam -->
+
+ <listener>
+ <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>Seam Filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <servlet>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <url-pattern>/seam/resource/*</url-pattern>
+ </servlet-mapping>
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!-- JSF -->
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.seam</url-pattern>
+ </servlet-mapping>
+
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+</web-app>
1.9 +0 -0 jboss-seam/examples/spring/resources/WEB-INF/faces-config.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: faces-config.xml
===================================================================
RCS file: faces-config.xml
diff -N faces-config.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ faces-config.xml 17 Jul 2007 18:43:56 -0000 1.9
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config version="1.2"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <!-- Facelets support -->
+ <application>
+ <variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
+ <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ </application>
+
+</faces-config>
1.8 +89 -51 jboss-seam/examples/spring/resources/WEB-INF/applicationContext.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: applicationContext.xml
===================================================================
RCS file: applicationContext.xml
diff -N applicationContext.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ applicationContext.xml 17 Jul 2007 18:43:56 -0000 1.8
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop"
+ xmlns:util="http://www.springframework.org/schema/util" xmlns:seam="http://jboss.com/products/seam/spring-seam"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
+ xmlns:jee="http://www.springframework.org/schema/jee"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
+ http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd
+ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
+ http://jboss.com/products/seam/spring-seam http://jboss.com/products/seam/spring-seam-2.0.xsd
+ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"
+ default-lazy-init="true">
+
+ <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:mem:defaultDB"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </bean>
+
+ <!-- Here we are using a spring configured EMF you can just as easily use a Seam configured EMF using
+ <persistence:entity-manager-factory/> unless your project depends upon some functionality spring
+ provides an EMF such as the ability to inject a dataSource.
+ -->
+ <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+ <property name="dataSource" ref="dataSource"/>
+ <property name="persistenceUnitName" value="bookingDatabase"/>
+ </bean>
+
+ <!-- This example uses resource local JpaTransactionManager. You could just as easily use a JtaTransactionManager -->
+ <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
+ <!-- Be sure to specify the SeamManagedEntityManagerFactory since that will manage the EM that will be
+ beginning and ending transactions.-->
+ <property name="entityManagerFactory" ref="seamEntityManagerFactory"/>
+ </bean>
+
+ <tx:annotation-driven proxy-target-class="true" />
+
+ <!-- Example using PersistenceAnnotationBeanPostProcessor for persistence -->
+ <bean id="userService" class="org.jboss.seam.example.spring.UserService"/>
+
+ <!-- Example using JpaDaoSupport for persistence -->
+ <bean id="bookingService" class="org.jboss.seam.example.spring.BookingService">
+ <property name="entityManagerFactory" ref="seamEntityManagerFactory" />
+ <seam:component/>
+ </bean>
+
+ <!-- Testing out a seam scoped spring bean -->
+ <bean id="hotelSearch" class="org.jboss.seam.example.spring.HotelSearchingAction" scope="seam.SESSION">
+ <!-- Testing creation time injection -->
+ <property name="pageSize" value="10" />
+ </bean>
+
+ <seam:configure-scopes />
+
+ <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor">
+ <!-- Because we have multiple EntityManagerFactories in this applicaitonContext identify the
+ SeamManagedEntityManagerFactory as the default -->
+ <property name="defaultPersistenceUnitName" value="conversationScoped"/>
+ </bean>
+
+ <!-- EMF that wraps a Seam Managed EM instance for use in Spring -->
+ <bean id="seamEntityManagerFactory" class="org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactoryBean">
+ <!-- The Seam managed-persistence-context component name. -->
+ <property name="persistenceContextName" value="entityManager" />
+ <!-- Optionally provide a unit name. If not specified the default would be the persistenceContextName -->
+ <property name="persistenceUnitName" value="conversationScoped"/>
+ </bean>
+
+ <!-- TaskExecutor for example use of @Asynchronous -->
+ <bean id="springThreadPoolTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor" />
+
+
+ <!-- Sample Hibernate Configuration -->
+
+ <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
+ <property name="dataSource" ref="dataSource"/>
+ <property name="annotatedClasses">
+ <list>
+ <value>org.jboss.seam.example.spring.Hotel</value>
+ <value>org.jboss.seam.example.spring.User</value>
+ <value>org.jboss.seam.example.spring.Booking</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="seamSessionFactory" class="org.jboss.seam.ioc.spring.SeamManagedSessionFactoryBean">
+ <property name="sessionName" value="hibernateSession"/>
+ </bean>
+
+ <bean id="hibernateTestService" class="org.jboss.seam.example.spring.HibernateTestService">
+ <property name="sessionFactory" ref="seamSessionFactory"/>
+ <property name="transactionTemplate" ref="hibernateTransactionTemplate"/>
+ </bean>
+
+ <bean id="hibernateTransactionTemplate" class="org.springframework.transaction.support.TransactionTemplate">
+ <property name="transactionManager" ref="hibernateTransactionManager"/>
+ </bean>
+
+ <bean id="hibernateTransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
+ <property name="sessionFactory" ref="seamSessionFactory"/>
+ </bean>
+</beans>
1.12 +0 -0 jboss-seam/examples/spring/resources/WEB-INF/pages.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: pages.xml
===================================================================
RCS file: pages.xml
diff -N pages.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pages.xml 17 Jul 2007 18:43:56 -0000 1.12
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pages xmlns="http://jboss.com/products/seam/pages"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"
+
+ no-conversation-view-id="/main.xhtml">
+
+ <page view-id="/register.xhtml">
+
+ <action if="#{validation.failed}"
+ execute="#{register.invalid}"/>
+
+ <navigation>
+ <rule if="#{register.registered}">
+ <redirect view-id="/home.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/home.xhtml">
+
+ <navigation>
+ <rule if="#{login.loggedIn}">
+ <redirect view-id="/main.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/password.xhtml">
+
+ <navigation>
+ <rule if="#{changePassword.changed}">
+ <redirect view-id="/main.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/main.xhtml">
+
+ <action execute="#{login.validateLogin}"/>
+
+ <navigation from-action="#{login.validateLogin}">
+ <rule if="#{not login.loggedIn}">
+ <redirect view-id="/home.xhtml"/>
+ </rule>
+ </navigation>
+
+ <navigation from-action="#{hotelBooking.selectHotel(hot)}">
+ <redirect view-id="/hotel.xhtml"/>
+ </navigation>
+
+ </page>
+
+ <page view-id="/hotel.xhtml"
+ conversation-required="true">
+
+ <description>View hotel: #{hotel.name}</description>
+
+ <navigation from-action="#{hotelBooking.bookHotel}">
+ <redirect view-id="/book.xhtml"/>
+ </navigation>
+
+ </page>
+
+ <page view-id="/book.xhtml"
+ conversation-required="true">
+
+ <description>Book hotel: #{hotel.name}</description>
+
+ <navigation from-action="#{hotelBooking.setBookingDetails}">
+ <redirect view-id="/confirm.xhtml"/>
+ </navigation>
+
+ </page>
+
+ <page view-id="/confirm.xhtml"
+ conversation-required="true">
+
+ <description>Confirm booking: #{booking.description}</description>
+
+ <navigation from-action="#{hotelBooking.confirm}">
+ <redirect view-id="/main.xhtml"/>
+ </navigation>
+
+ </page>
+
+ <page view-id="*">
+
+ <navigation from-action="#{login.logout}">
+ <redirect view-id="/home.xhtml"/>
+ </navigation>
+
+ <navigation from-action="#{hotelBooking.cancel}">
+ <redirect view-id="/main.xhtml"/>
+ </navigation>
+
+ </page>
+
+</pages>
1.4 +0 -0 jboss-seam/examples/spring/resources/WEB-INF/navigation.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: navigation.xml
===================================================================
RCS file: navigation.xml
diff -N navigation.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ navigation.xml 17 Jul 2007 18:43:56 -0000 1.4
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config version="1.2"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>login</from-outcome>
+ <to-view-id>/home.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>register</from-outcome>
+ <to-view-id>/register.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>password</from-outcome>
+ <to-view-id>/password.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>main</from-outcome>
+ <to-view-id>/main.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>hotel</from-outcome>
+ <to-view-id>/hotel.xhtml</to-view-id>
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/hotel.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>book</from-outcome>
+ <to-view-id>/book.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+
+
+ <navigation-rule>
+ <from-view-id>/book.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>confirm</from-outcome>
+ <to-view-id>/confirm.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+
+
+ <navigation-rule>
+ <from-view-id>/confirm.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>confirmed</from-outcome>
+ <to-view-id>/main.xhtml</to-view-id>
+
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>back</from-outcome>
+ <to-view-id>/book.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+</faces-config>
+
More information about the jboss-cvs-commits
mailing list