[jboss-cvs] JBossAS SVN: r91744 - in projects/spring-int/trunk/documentation/samples: orders and 38 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jul 28 17:58:28 EDT 2009


Author: marius.bogoevici
Date: 2009-07-28 17:58:28 -0400 (Tue, 28 Jul 2009)
New Revision: 91744

Added:
   projects/spring-int/trunk/documentation/samples/orders/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/pom.xml
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/ejb/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/ejb/OrderService.java
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/ejb/OrderServiceBean.java
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/ejb/UserService.java
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/ejb/UserServiceBean.java
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/entities/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/entities/Order.java
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/entities/OrderItem.java
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/entities/User.java
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/repository/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/repository/JpaOrderRepository.java
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/repository/JpaUserRepository.java
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/repository/OrderRepository.java
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/repository/UserRepository.java
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/META-INF/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/META-INF/persistence.xml
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/application-context.xml
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/application-infrastructure.xml
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/beanRefContext.xml
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/java/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/java/org/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/java/org/jboss/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/java/org/jboss/spring/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/java/org/jboss/spring/samples/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/java/org/jboss/spring/samples/orders/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/java/org/jboss/spring/samples/orders/JpaOrderDaoTests.java
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/resources/
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/resources/persistence.xml
   projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/resources/test-infrastructure.xml
   projects/spring-int/trunk/documentation/samples/orders/orders-ear/
   projects/spring-int/trunk/documentation/samples/orders/orders-ear/pom.xml
   projects/spring-int/trunk/documentation/samples/orders/orders-web/
   projects/spring-int/trunk/documentation/samples/orders/orders-web/pom.xml
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/java/
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/java/org/
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/java/org/jboss/
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/java/org/jboss/spring/
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/java/org/jboss/spring/samples/
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/java/org/jboss/spring/samples/orders/
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/java/org/jboss/spring/samples/orders/web/
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/java/org/jboss/spring/samples/orders/web/OrdersView.java
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/WEB-INF/
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/WEB-INF/jsp/
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/WEB-INF/jsp/orders/
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/WEB-INF/jsp/orders/created-by.jsp
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/WEB-INF/spring-servlet-context.xml
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/WEB-INF/web.xml
   projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/index.jsp
   projects/spring-int/trunk/documentation/samples/orders/pom.xml
Log:
Adding a first version of an EJB3 - Spring sample.

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/pom.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/pom.xml	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/pom.xml	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>orders</artifactId>
+        <groupId>org.jboss.spring-int.samples</groupId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.jboss.spring-int.samples</groupId>
+    <artifactId>orders-domain</artifactId>
+    <packaging>ejb</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <dependencies>
+        <dependency>
+            <groupId>javax.persistence</groupId>
+            <artifactId>persistence-api</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring</artifactId>
+            <version>2.5.6.SEC01</version>
+        </dependency>
+        <dependency>
+            <groupId>hsqldb</groupId>
+            <artifactId>hsqldb</artifactId>
+            <version>1.8.0.10</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-dbcp</groupId>
+            <artifactId>commons-dbcp</artifactId>
+            <version>1.2.2</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.4</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <version>2.5.6.SEC01</version>
+        </dependency>
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-core</artifactId>
+            <version>3.3.1.GA</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-annotations</artifactId>
+            <version>3.4.0.GA</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-entitymanager</artifactId>
+            <version>3.4.0.GA</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>1.5.6</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-jdk14</artifactId>
+            <version>1.5.6</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.ejb</groupId>
+            <artifactId>ejb-api</artifactId>
+            <version>3.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.spring-int</groupId>
+            <artifactId>jboss-spring-int-vfs</artifactId>
+            <version>1.1.0-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+    <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-ejb-plugin</artifactId>
+        <configuration>
+          <ejbVersion>3.0</ejbVersion>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/ejb/OrderService.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/ejb/OrderService.java	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/ejb/OrderService.java	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,17 @@
+package org.jboss.spring.samples.orders.domain.ejb;
+
+import org.jboss.spring.samples.orders.domain.entities.Order;
+
+import javax.ejb.Local;
+import java.util.List;
+
+/**
+ * @author: marius
+ */
+ at Local
+public interface OrderService
+{
+
+   List<Order> getOrdersForUserId(String userId);
+
+}

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/ejb/OrderServiceBean.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/ejb/OrderServiceBean.java	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/ejb/OrderServiceBean.java	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,44 @@
+package org.jboss.spring.samples.orders.domain.ejb;
+
+import org.jboss.spring.vfs.context.VFSClassPathXmlApplicationContext;
+import org.jboss.spring.samples.orders.domain.repository.UserRepository;
+import org.jboss.spring.samples.orders.domain.repository.OrderRepository;
+import org.jboss.spring.samples.orders.domain.entities.Order;
+import org.jboss.spring.samples.orders.domain.entities.User;
+import org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.ejb.Stateless;
+import javax.interceptor.Interceptors;
+import java.util.List;
+
+/**
+ * @author: marius
+ */
+ at Stateless
+ at Interceptors(SpringBeanAutowiringInterceptor.class)
+public class OrderServiceBean implements OrderService
+{
+   @Autowired
+   private UserRepository userRepository;
+
+   @Autowired
+   private OrderRepository orderRepository;
+
+   public OrderServiceBean()
+   {
+//      VFSClassPathXmlApplicationContext applicationContext =
+//            new VFSClassPathXmlApplicationContext(
+//                  new String[]{"classpath:/application-context.xml",
+//                        "classpath:/application-infrastructure.xml"});
+//
+//      userRepository = ((UserRepository) applicationContext.getBeansOfType(UserRepository.class).values().iterator().next());
+//      orderRepository = ((OrderRepository) applicationContext.getBeansOfType(OrderRepository.class).values().iterator().next());
+   }
+
+   public List<Order> getOrdersForUserId(String userId)
+   {
+      User u = userRepository.getUserById(userId);
+      return orderRepository.getOrdersForUser(u);
+   }
+}

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/ejb/UserService.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/ejb/UserService.java	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/ejb/UserService.java	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,17 @@
+package org.jboss.spring.samples.orders.domain.ejb;
+
+import org.jboss.spring.samples.orders.domain.repository.UserRepository;
+import org.jboss.spring.samples.orders.domain.entities.User;
+
+import javax.ejb.Local;
+
+/**
+ * @author: marius
+ */
+ at Local
+public interface UserService
+{
+
+   User createUser(String id);
+
+}

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/ejb/UserServiceBean.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/ejb/UserServiceBean.java	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/ejb/UserServiceBean.java	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,33 @@
+package org.jboss.spring.samples.orders.domain.ejb;
+
+import org.jboss.spring.samples.orders.domain.repository.UserRepository;
+import org.jboss.spring.samples.orders.domain.entities.User;
+import org.jboss.spring.vfs.context.VFSClassPathXmlApplicationContext;
+
+import javax.ejb.Stateless;
+
+/**
+ * @author: marius
+ */
+ at Stateless
+public class UserServiceBean implements UserService
+{
+
+   private UserRepository userRepository;
+
+   public UserServiceBean()
+   {
+      VFSClassPathXmlApplicationContext applicationContext =
+            new VFSClassPathXmlApplicationContext(
+                  new String[]{"classpath:/application-context.xml",
+                        "classpath:/application-infrastructure.xml"});
+
+      userRepository = ((UserRepository) applicationContext.getBeansOfType(UserRepository.class).values().iterator().next());
+   }
+
+   public User createUser(String id)
+   {
+      return userRepository.createUser(id);
+   }
+   
+}

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/entities/Order.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/entities/Order.java	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/entities/Order.java	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,47 @@
+package org.jboss.spring.samples.orders.domain.entities;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.ManyToOne;
+import javax.persistence.JoinColumn;
+
+/**
+ * @author: marius
+ */
+ at Entity
+ at Table(name = "ORDERS")
+public class Order {
+
+    @Id
+    @Column(name="ORDER_ID")
+    private long id;
+
+    @Column (name = "ORDER_NAME")
+    private String name;
+
+    @ManyToOne
+    @JoinColumn(name="ORDER_CREATED_BY")
+    private User createdBy;
+
+    public long getId() {
+        return id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public User getCreatedBy() {
+        return createdBy;
+    }
+
+    public void setCreatedBy(User createdBy) {
+        this.createdBy = createdBy;
+    }
+}

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/entities/OrderItem.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/entities/OrderItem.java	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/entities/OrderItem.java	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,55 @@
+package org.jboss.spring.samples.orders.domain.entities;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.Column;
+
+/**
+ * @author: marius
+ */
+ at Entity
+ at Table(name = "ORDER_ITEMS")
+public class OrderItem {
+
+    @Id
+    @Column(name="ORDER_ITEM_ID")
+    private long id;
+
+    @Column(name="ORDER_ITEM_NAME")
+    private String name;
+
+    @Column(name="ORDER_ITEM_QUANTITY")
+    private double quantity;
+
+    @Column(name="ORDER_ITEM_PRICE_PER_UNIT")
+    private double pricePerUnit;
+
+    public long getId() {
+        return id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public double getPricePerUnit() {
+        return pricePerUnit;
+    }
+
+    public void setPricePerUnit(double pricePerUnit) {
+        this.pricePerUnit = pricePerUnit;
+    }
+
+    public double getQuantity() {
+        return quantity;
+    }
+
+    public void setQuantity(double quantity) {
+        this.quantity = quantity;
+    }
+}

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/entities/User.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/entities/User.java	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/entities/User.java	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,28 @@
+package org.jboss.spring.samples.orders.domain.entities;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * @author: marius
+ */
+ at Entity
+ at Table(name= "USERS")
+public class User {
+
+    @Id
+    private String id;
+
+    public User(String id) {
+        this.id = id;
+    }
+
+    protected User() {
+        // no-arg constructor for persistence
+    }
+
+    public String getId() {
+        return id;
+    }
+}

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/repository/JpaOrderRepository.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/repository/JpaOrderRepository.java	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/repository/JpaOrderRepository.java	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,30 @@
+package org.jboss.spring.samples.orders.domain.repository;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.Query;
+
+import java.util.List;
+
+import org.jboss.spring.samples.orders.domain.entities.Order;
+import org.jboss.spring.samples.orders.domain.entities.User;
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * @author: marius
+ */
+ at Repository
+public class JpaOrderRepository implements OrderRepository {
+
+    @PersistenceContext
+    private EntityManager entityManager;
+
+    @Transactional
+    public List<Order> getOrdersForUser(User user) {
+        Query q = entityManager.createQuery("select o from Order o where o.createdBy.id = ?1");
+        q.setParameter(1, user.getId());
+        return (List<Order>) q.getResultList(); 
+    }
+
+}

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/repository/JpaUserRepository.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/repository/JpaUserRepository.java	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/repository/JpaUserRepository.java	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,28 @@
+package org.jboss.spring.samples.orders.domain.repository;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.jboss.spring.samples.orders.domain.entities.User;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @author: marius
+ */
+ at Repository
+public class JpaUserRepository implements UserRepository {
+
+    @PersistenceContext
+    private EntityManager entityManager;
+
+    public User getUserById(String id) {
+        return entityManager.find(User.class, id);
+    }
+
+   public User createUser(String id)
+   {
+      User u = new User(id);
+      entityManager.persist(u);
+      return u;
+   }
+}

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/repository/OrderRepository.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/repository/OrderRepository.java	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/repository/OrderRepository.java	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,15 @@
+package org.jboss.spring.samples.orders.domain.repository;
+
+import java.util.List;
+
+import org.jboss.spring.samples.orders.domain.entities.Order;
+import org.jboss.spring.samples.orders.domain.entities.User;
+
+/**
+ * @author: marius
+ */
+public interface OrderRepository {
+
+    List<Order> getOrdersForUser(User user);
+
+}

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/repository/UserRepository.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/repository/UserRepository.java	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/java/org/jboss/spring/samples/orders/domain/repository/UserRepository.java	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,13 @@
+package org.jboss.spring.samples.orders.domain.repository;
+
+import org.jboss.spring.samples.orders.domain.entities.User;
+
+/**
+ * @author: marius
+ */
+public interface UserRepository {
+
+   User getUserById(String id);
+
+   User createUser(String id);
+}

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/META-INF/persistence.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/META-INF/persistence.xml	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/META-INF/persistence.xml	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
+    <persistence-unit name="orders" transaction-type="JTA">
+        <jta-data-source>java:/DefaultDS</jta-data-source>
+        <properties>
+            <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
+            <property name="jboss.entity.manager.jndi.name" value="java:/persistence/orders"/>
+            <property name="jboss.entity.manager.factory.jndi.name" value="java:/persistence/orders-emf"/>
+        </properties>
+    </persistence-unit>
+</persistence>
\ No newline at end of file

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/application-context.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/application-context.xml	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/application-context.xml	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:tx="http://www.springframework.org/schema/tx"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
+       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
+
+    <context:annotation-config/>
+
+    <context:component-scan base-package="org.jboss.spring.samples.orders.domain"/>
+
+</beans>
\ No newline at end of file

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/application-infrastructure.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/application-infrastructure.xml	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/application-infrastructure.xml	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:jee="http://www.springframework.org/schema/jee"
+       xmlns:tx="http://www.springframework.org/schema/tx"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+                http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
+                http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
+    
+    <jee:jndi-lookup proxy-interface="javax.persistence.EntityManagerFactory" id="entityManagerFactory" jndi-name="java:/persistence/orders-emf"/>
+
+    <tx:jta-transaction-manager/>
+
+    <tx:annotation-driven/>
+</beans>
\ No newline at end of file

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/beanRefContext.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/beanRefContext.xml	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/main/resources/beanRefContext.xml	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+   <bean id="context1" class="org.jboss.spring.vfs.context.VFSClassPathXmlApplicationContext">
+       <constructor-arg>
+           <list>
+                <value>application-context.xml</value>
+                <value>application-infrastructure.xml</value>
+           </list>
+       </constructor-arg>
+   </bean>
+</beans>
\ No newline at end of file

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/java/org/jboss/spring/samples/orders/JpaOrderDaoTests.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/java/org/jboss/spring/samples/orders/JpaOrderDaoTests.java	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/java/org/jboss/spring/samples/orders/JpaOrderDaoTests.java	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,59 @@
+package org.jboss.spring.samples.orders;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import java.util.List;
+
+import org.jboss.spring.samples.orders.domain.entities.Order;
+import org.jboss.spring.samples.orders.domain.entities.User;
+import org.jboss.spring.samples.orders.domain.repository.OrderRepository;
+import org.jboss.spring.samples.orders.domain.repository.UserRepository;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * @author: marius
+ */
+ at ContextConfiguration(locations = {"classpath:application-context.xml", "classpath:test-infrastructure.xml"})
+ at RunWith(SpringJUnit4ClassRunner.class)
+public class JpaOrderDaoTests {
+
+    @Autowired
+    private OrderRepository orderRepository;
+
+    @Autowired
+    private UserRepository userRepository;
+
+    @PersistenceContext
+    EntityManager manager;
+
+    @Before
+    @Transactional
+    public void setUp() {
+        User u = userRepository.getUserById("user1");
+        if (u == null) {
+            User newUser = new User("user1");
+            manager.persist(newUser);
+            Order o = new Order();
+            o.setCreatedBy(newUser);
+            o.setName("A new order");
+            manager.persist(o);
+        }
+    }
+
+    @Test
+    @Transactional
+    public void testGetOrders() {
+        User u = userRepository.getUserById("user1");
+        Assert.assertNotNull(u);
+        List<Order> orders = orderRepository.getOrdersForUser(u);
+        Assert.assertTrue(orders.size() > 0);
+    }
+}

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/resources/persistence.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/resources/persistence.xml	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/resources/persistence.xml	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
+    <persistence-unit name="orders" transaction-type="RESOURCE_LOCAL">
+        <class>org.jboss.spring.samples.orders.domain.entities.User</class>
+        <class>org.jboss.spring.samples.orders.domain.entities.Order</class>
+        <class>org.jboss.spring.samples.orders.domain.entities.OrderItem</class>
+        </persistence-unit>
+</persistence>
\ No newline at end of file

Added: projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/resources/test-infrastructure.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/resources/test-infrastructure.xml	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-domain/src/test/resources/test-infrastructure.xml	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
+        <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+        <property name="url" value="jdbc:hsqldb:mem:aname"/>
+    </bean>
+
+    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
+        <property name="entityManagerFactory" ref="entityManagerFactory"/>
+    </bean>
+
+    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+        <property name="dataSource" ref="dataSource"/>
+        <property name="persistenceXmlLocation" value="classpath:persistence.xml"/>
+        <property name="jpaVendorAdapter">
+        <bean
+        class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
+           <property name="showSql" value="true" />
+           <property name="generateDdl" value="true" />
+           <property name="databasePlatform" value="org.hibernate.dialect.HSQLDialect" />
+        </bean>
+     </property>
+      </bean>
+
+</beans>
\ No newline at end of file

Added: projects/spring-int/trunk/documentation/samples/orders/orders-ear/pom.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-ear/pom.xml	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-ear/pom.xml	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>orders</artifactId>
+        <groupId>org.jboss.spring-int.samples</groupId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.jboss.spring-int.samples</groupId>
+    <artifactId>orders-ear</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>ear</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.jboss.spring-int.samples</groupId>
+            <artifactId>orders-domain</artifactId>
+            <version>${project.version}</version>
+            <type>ejb</type>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.spring-int.samples</groupId>
+            <artifactId>orders-web</artifactId>
+            <version>${project.version}</version>
+            <type>war</type>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-web</artifactId>
+            <version>2.5.6.SEC01</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-webmvc</artifactId>
+            <version>2.5.6.SEC01</version>
+        </dependency>
+        <dependency>
+            <groupId>cglib</groupId>
+            <artifactId>cglib-nodep</artifactId>
+            <version>2.2</version>
+        </dependency>
+    </dependencies>
+    <build>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-ear-plugin</artifactId>
+          <version>2.3.2</version>
+          <configuration>
+            <displayName>Orders Sample</displayName>
+            <finalName>orders</finalName>
+            <earName>orders</earName>
+            <defaultLibBundleDir>/lib/</defaultLibBundleDir>
+            <modules>
+              <ejbModule>
+                <groupId>org.jboss.spring-int.samples</groupId>
+                <artifactId>orders-domain</artifactId>
+              </ejbModule>
+              <webModule>
+                <groupId>org.jboss.spring-int.samples</groupId>
+                <artifactId>orders-web</artifactId>
+                <contextRoot>/orders</contextRoot>
+              </webModule>
+            </modules>
+          </configuration>
+        </plugin>
+      </plugins>
+    </build>
+
+</project>
\ No newline at end of file

Added: projects/spring-int/trunk/documentation/samples/orders/orders-web/pom.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-web/pom.xml	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-web/pom.xml	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,75 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <artifactId>orders</artifactId>
+        <groupId>org.jboss.spring-int.samples</groupId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.jboss.spring-int.samples</groupId>
+    <artifactId>orders-web</artifactId>
+    <packaging>war</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>orders-web Maven Webapp</name>
+    <url>http://maven.apache.org</url>
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.4</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-web</artifactId>
+            <version>2.5.6.SEC01</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-webmvc</artifactId>
+            <version>2.5.6.SEC01</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.spring-int</groupId>
+            <artifactId>jboss-spring-int-vfs</artifactId>
+            <version>1.1.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.jboss.spring-int.samples</groupId>
+            <artifactId>orders-domain</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+            <type>ejb</type>
+        </dependency>
+        <dependency>
+            <groupId>taglibs</groupId>
+            <artifactId>standard</artifactId>
+            <version>1.1.2</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.ejb</groupId>
+            <artifactId>ejb-api</artifactId>
+            <version>3.0</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <finalName>orders-web</finalName>
+        <plugins>
+            <plugin>
+                <artifactId>maven-war-plugin</artifactId>
+                <configuration>
+                    <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
+                    <archive>
+                        <manifest>
+                            <addClasspath>true</addClasspath>
+                            <classpathPrefix>lib/</classpathPrefix>
+                        </manifest>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Added: projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/java/org/jboss/spring/samples/orders/web/OrdersView.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/java/org/jboss/spring/samples/orders/web/OrdersView.java	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/java/org/jboss/spring/samples/orders/web/OrdersView.java	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,32 @@
+package org.jboss.spring.samples.orders.web;
+
+import java.util.List;
+
+import org.jboss.spring.samples.orders.domain.entities.Order;
+import org.jboss.spring.samples.orders.domain.ejb.OrderService;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.ejb.EJB;
+
+
+/**
+ * @author: marius
+ */
+ at Controller
+ at RequestMapping("/orders/*")
+public class OrdersView {
+
+   @EJB(mappedName = "orders-ear-1.0.0-SNAPSHOT/OrderServiceBean/local")
+   private OrderService orderService;
+
+   @RequestMapping("created-by")
+   @Transactional
+   public @ModelAttribute("orders") List<Order> getOrdersCreatedBy(@RequestParam("user") String userId) {
+        return orderService.getOrdersForUserId(userId);
+   }
+    
+}

Added: projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/WEB-INF/jsp/orders/created-by.jsp
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/WEB-INF/jsp/orders/created-by.jsp	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/WEB-INF/jsp/orders/created-by.jsp	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,16 @@
+<%@taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
+<%--
+  Created by IntelliJ IDEA.
+  User: marius
+  Date: Jul 23, 2009
+  Time: 12:29:20 AM
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+  <head><title>Simple jsp page</title></head>
+  <body>Place your content here</body>
+  <c:forEach items="${orders}" var="order">
+      <c:out value="${order.name}"/> created by <c:out value="${order.createdBy.id}"/><p/>
+  </c:forEach>
+</html>
\ No newline at end of file

Added: projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/WEB-INF/spring-servlet-context.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/WEB-INF/spring-servlet-context.xml	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/WEB-INF/spring-servlet-context.xml	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:jee="http://www.springframework.org/schema/jee"
+       xmlns:tx="http://www.springframework.org/schema/tx"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+                http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
+                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
+                http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
+
+    <context:annotation-config/>
+
+    <context:component-scan base-package="org.jboss.spring.samples.orders.web"/>
+
+    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+        <property name="prefix" value="/WEB-INF/jsp/"/>
+        <property name="suffix" value=".jsp"/>
+    </bean>
+
+    <tx:jta-transaction-manager/>
+
+    <tx:annotation-driven/>
+</beans>
\ No newline at end of file

Added: projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/WEB-INF/web.xml	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/WEB-INF/web.xml	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,40 @@
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+
+<web-app>
+  <display-name>Archetype Created Web Application</display-name>
+  <!--<context-param>-->
+      <!--<param-name>contextConfigLocation</param-name>-->
+      <!--<param-value>-->
+          <!--classpath*:/application-context.xml,-->
+          <!--classpath*:/application-infrastructure.xml-->
+      <!--</param-value>-->
+  <!--</context-param>-->
+
+    <!--<context-param>-->
+        <!--<param-name>contextClass</param-name>-->
+        <!--<param-value>org.jboss.spring.vfs.context.VFSXmlWebApplicationContext</param-value>-->
+    <!--</context-param>-->
+  <!--<listener>-->
+      <!--<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>-->
+  <!--</listener>-->
+
+    <servlet>
+        <servlet-name>Spring-Servlet</servlet-name>
+        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+        <init-param>
+            <param-name>contextConfigLocation</param-name>
+            <param-value>/WEB-INF/spring-servlet-context.xml</param-value>
+        </init-param>
+        <init-param>
+            <param-name>contextClass</param-name>
+            <param-value>org.jboss.spring.vfs.context.VFSXmlWebApplicationContext</param-value>
+        </init-param>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>Spring-Servlet</servlet-name>
+        <url-pattern>/spring/*</url-pattern>
+    </servlet-mapping>
+</web-app>
\ No newline at end of file

Added: projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/index.jsp
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/index.jsp	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/orders-web/src/main/webapp/index.jsp	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<h2>Hello World!</h2>
+</body>
+</html>

Added: projects/spring-int/trunk/documentation/samples/orders/pom.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/orders/pom.xml	                        (rev 0)
+++ projects/spring-int/trunk/documentation/samples/orders/pom.xml	2009-07-28 21:58:28 UTC (rev 91744)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.jboss.spring-int.samples</groupId>
+    <artifactId>orders</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <modules>
+        <module>orders-domain</module>
+        <module>orders-ear</module>
+        <module>orders-web</module>
+    </modules>
+    <packaging>pom</packaging>
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.jboss.spring-int.samples</groupId>
+                <artifactId>orders-domain</artifactId>
+                <version>${project.version}</version>
+                <type>ejb</type>
+            </dependency>
+            <dependency>
+                <groupId>org.jboss.spring-int.samples</groupId>
+                <artifactId>orders-web</artifactId>
+                <version>${project.version}</version>
+                 <type>war</type>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file




More information about the jboss-cvs-commits mailing list