[jboss-cvs] JBossAS SVN: r90447 - in projects/spring-int/trunk/documentation/samples: horoscope and 26 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jun 18 18:21:25 EDT 2009
Author: marius.bogoevici
Date: 2009-06-18 18:21:25 -0400 (Thu, 18 Jun 2009)
New Revision: 90447
Added:
projects/spring-int/trunk/documentation/samples/horoscope/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ear/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ear/pom.xml
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/pom.xml
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/ejb/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/ejb/Horoscope.java
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/ejb/HoroscopeBean.java
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/ejb/Randomizer.java
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/ejb/RandomizerBean.java
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/DummyStateIntCreator.java
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/FileLineReader.java
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/IntCreator.java
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/JavaRandomIntCreator.java
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/RandomFileWordsCreator.java
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/StaticWordsCreator.java
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/WordsCreator.java
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/resources/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/resources/META-INF/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/resources/META-INF/jboss-spring.xml
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/resources/horoscope.properties
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/resources/words.properties
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/pom.xml
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/java/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/java/org/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/java/org/jboss/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/java/org/jboss/tutorial/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/java/org/jboss/tutorial/web/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/java/org/jboss/tutorial/web/AppController.java
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/applicationContext.xml
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/classes/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/classes/views.properties
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/jboss-spring-servlet.xml
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/jsp/
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/jsp/horoscope.jsp
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/web.xml
projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/index.jsp
projects/spring-int/trunk/documentation/samples/horoscope/pom.xml
Log:
Adding and reorganising the Horoscope sample from the JBoss AS project. Cleanup, mavenization, bringing it up to date.
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ear/pom.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ear/pom.xml (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ear/pom.xml 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,72 @@
+<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>horoscope</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>horoscope-ear</artifactId>
+ <packaging>ear</packaging>
+ <name>horoscope-ear Maven Webapp</name>
+ <url>http://maven.apache.org</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.spring-int.samples</groupId>
+ <artifactId>horoscope-war</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.spring-int.samples</groupId>
+ <artifactId>horoscope-ejb</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <type>ejb</type>
+ </dependency>
+<!--
+ <dependency>
+ <groupId>org.jboss.spring-int.samples</groupId>
+ <artifactId>horoscope-spring</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+-->
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <displayName>JBoss Spring</displayName>
+ <finalName>horoscope</finalName>
+ <earName>horoscope</earName>
+ <defaultLibBundleDir>/lib/</defaultLibBundleDir>
+ <modules>
+ <ejbModule>
+ <groupId>org.jboss.spring-int.samples</groupId>
+ <artifactId>horoscope-ejb</artifactId>
+ </ejbModule>
+ <webModule>
+ <groupId>org.jboss.spring-int.samples</groupId>
+ <artifactId>horoscope-war</artifactId>
+ <contextRoot>/horoscope</contextRoot>
+ </webModule>
+<!--
+ <jarModule>
+ <groupId>org.jboss.spring-int.samples</groupId>
+ <artifactId>horoscope-spring</artifactId>
+ <bundleDir>/</bundleDir>
+ </jarModule>
+-->
+ </modules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+
+</project>
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/pom.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/pom.xml (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/pom.xml 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,43 @@
+<?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>horoscope</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>horoscope-ejb</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>ejb</packaging>
+ <dependencies>
+ <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-deployers</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.client</groupId>
+ <artifactId>jbossall-client</artifactId>
+ <version>5.0.0.Beta4</version>
+ <scope>provided</scope>
+ </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/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/ejb/Horoscope.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/ejb/Horoscope.java (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/ejb/Horoscope.java 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.spring.samples.horoscope.ejb;
+
+import javax.ejb.Local;
+
+/**
+ * @author <a href="mailto:ales.justin at genera-lynx.com">Ales Justin</a>
+ */
+ at Local
+public interface Horoscope
+{
+ String getHoroscope(int month);
+
+ void clear();
+}
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/ejb/HoroscopeBean.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/ejb/HoroscopeBean.java (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/ejb/HoroscopeBean.java 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.spring.samples.horoscope.ejb;
+
+import java.io.Serializable;
+import java.util.Set;
+import java.util.TreeSet;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.interceptor.Interceptors;
+
+import org.jboss.annotation.spring.Spring;
+import org.jboss.spring.callback.SpringLifecycleInterceptor;
+import org.jboss.spring.samples.horoscope.ejb.Horoscope;
+import org.jboss.spring.samples.horoscope.spring.WordsCreator;
+import org.jboss.ejb3.annotation.LocalBinding;
+
+/**
+ * @author <a href="mailto:ales.justin at genera-lynx.com">Ales Justin</a>
+ */
+ at Stateful
+ at Interceptors(SpringLifecycleInterceptor.class)
+public class HoroscopeBean implements Horoscope, Serializable
+{
+
+ private static final long serialVersionUID = 2300669204640707036L;
+
+ private Set<String> sentences = new TreeSet<String>();
+
+ @Spring(jndiName = "horoscopeContext", bean = "horoscopeSentenceCreator")
+ private WordsCreator horoscopeCreator;
+
+ public String getHoroscope(int month)
+ {
+ String sentence = horoscopeCreator.createWord();
+ if (!sentences.add(sentence))
+ {
+ System.out.println("Repeating horoscope sentence.");
+ }
+ return sentence;
+ }
+
+ @Remove
+ public void clear()
+ {
+ sentences.clear();
+ }
+
+}
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/ejb/Randomizer.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/ejb/Randomizer.java (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/ejb/Randomizer.java 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.spring.samples.horoscope.ejb;
+
+import javax.ejb.Local;
+
+/**
+ * @author <a href="mailto:ales.justin at genera-lynx.com">Ales Justin</a>
+ */
+ at Local
+public interface Randomizer
+{
+ int getNumber(int radius);
+
+ String getWord();
+}
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/ejb/RandomizerBean.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/ejb/RandomizerBean.java (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/ejb/RandomizerBean.java 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.spring.samples.horoscope.ejb;
+
+import javax.ejb.Stateless;
+import javax.interceptor.Interceptors;
+
+import org.jboss.annotation.spring.Spring;
+import org.jboss.spring.samples.horoscope.ejb.Randomizer;
+import org.jboss.spring.samples.horoscope.spring.IntCreator;
+import org.jboss.spring.samples.horoscope.spring.WordsCreator;
+import org.jboss.spring.callback.SpringLifecycleInterceptor;
+import org.jboss.ejb3.annotation.LocalBinding;
+
+/**
+ * @author <a href="mailto:ales.justin at genera-lynx.com">Ales Justin</a>
+ */
+ at Stateless
+ at Interceptors(org.jboss.spring.callback.SpringLifecycleInterceptor.class)
+public class
+ RandomizerBean implements Randomizer
+{
+
+ private WordsCreator wordsCreator;
+
+ @Spring(jndiName = "horoscopeContext", bean = "stateIntCreator")
+ private IntCreator intCreator;
+
+ public WordsCreator getWordsCreator()
+ {
+ return wordsCreator;
+ }
+
+ @Spring(jndiName = "horoscopeContext", bean = "staticWordsCreator")
+ public void setWordsCreator(WordsCreator wordsCreator)
+ {
+ this.wordsCreator = wordsCreator;
+ }
+
+ public int getNumber(int radius)
+ {
+ return intCreator.createInt(radius);
+ }
+
+ public String getWord()
+ {
+ return getWordsCreator().createWord();
+ }
+
+}
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/DummyStateIntCreator.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/DummyStateIntCreator.java (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/DummyStateIntCreator.java 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.spring.samples.horoscope.spring;
+
+/**
+ * @author <a href="mailto:ales.justin at genera-lynx.com">Ales Justin</a>
+ */
+public class DummyStateIntCreator implements IntCreator
+{
+
+ private int state = 1;
+
+ public int createInt(int radius)
+ {
+ state = (state * 3 * 7 * 19 * 37) % radius;
+ return state;
+ }
+
+}
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/FileLineReader.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/FileLineReader.java (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/FileLineReader.java 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.spring.samples.horoscope.spring;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.core.io.Resource;
+
+/**
+ * @author <a href="mailto:ales.justin at genera-lynx.com">Ales Justin</a>
+ */
+public class FileLineReader extends StaticWordsCreator implements InitializingBean
+{
+
+ private Resource resource;
+ protected List<String> words;
+
+ public Resource getResource()
+ {
+ return resource;
+ }
+
+ public void setResource(Resource resource)
+ {
+ this.resource = resource;
+ }
+
+ public void afterPropertiesSet() throws Exception
+ {
+ if (getResource() == null)
+ {
+ throw new IllegalArgumentException("Resource must be set!");
+ }
+ BufferedReader reader = new BufferedReader(new InputStreamReader(getResource().getInputStream()));
+ try
+ {
+ words = new ArrayList<String>();
+ String line;
+ while ((line = reader.readLine()) != null)
+ {
+ words.add(line);
+ }
+ }
+ finally
+ {
+ reader.close();
+ }
+ }
+
+ protected String[] getArray()
+ {
+ return words.toArray(new String[words.size()]);
+ }
+
+}
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/IntCreator.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/IntCreator.java (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/IntCreator.java 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.spring.samples.horoscope.spring;
+
+/**
+ * @author <a href="mailto:ales.justin at genera-lynx.com">Ales Justin</a>
+ */
+public interface IntCreator
+{
+ int createInt(int radius);
+}
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/JavaRandomIntCreator.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/JavaRandomIntCreator.java (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/JavaRandomIntCreator.java 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.spring.samples.horoscope.spring;
+
+import java.util.Random;
+
+/**
+ * @author <a href="mailto:ales.justin at genera-lynx.com">Ales Justin</a>
+ */
+public class JavaRandomIntCreator implements IntCreator
+{
+
+ private Random random = new Random();
+
+ public int createInt(int radius)
+ {
+ return random.nextInt(radius);
+ }
+
+}
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/RandomFileWordsCreator.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/RandomFileWordsCreator.java (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/RandomFileWordsCreator.java 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.spring.samples.horoscope.spring;
+
+/**
+ * @author <a href="mailto:ales.justin at genera-lynx.com">Ales Justin</a>
+ */
+public class RandomFileWordsCreator extends FileLineReader
+{
+
+ private IntCreator intCreator;
+
+ public IntCreator getIntCreator()
+ {
+ return intCreator;
+ }
+
+ public void setIntCreator(IntCreator intCreator)
+ {
+ this.intCreator = intCreator;
+ }
+
+ public void afterPropertiesSet() throws Exception
+ {
+ super.afterPropertiesSet();
+ if (getIntCreator() == null)
+ {
+ throw new IllegalArgumentException("IntCreatot must be set!");
+ }
+ }
+
+ protected String getNext()
+ {
+ return words.get(getIntCreator().createInt(words.size()));
+ }
+
+}
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/StaticWordsCreator.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/StaticWordsCreator.java (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/StaticWordsCreator.java 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.spring.samples.horoscope.spring;
+
+/**
+ * @author <a href="mailto:ales.justin at genera-lynx.com">Ales Justin</a>
+ */
+public class StaticWordsCreator implements WordsCreator
+{
+
+ private static final String[] words = {
+ "Java",
+ "Enterprise",
+ "Beans",
+ "Word",
+ "Create",
+ "Spring",
+ "JBoss",
+ };
+
+ private int counter;
+
+ protected String[] getArray()
+ {
+ return words;
+ }
+
+ protected String getNext()
+ {
+ String[] array = getArray();
+ return array[(counter++) % array.length];
+ }
+
+ public String createWord()
+ {
+ return getNext();
+ }
+
+}
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/WordsCreator.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/WordsCreator.java (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/java/org/jboss/spring/samples/horoscope/spring/WordsCreator.java 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.spring.samples.horoscope.spring;
+
+/**
+ * @author <a href="mailto:ales.justin at genera-lynx.com">Ales Justin</a>
+ */
+public interface WordsCreator
+{
+
+ String createWord();
+
+}
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/resources/META-INF/jboss-spring.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/resources/META-INF/jboss-spring.xml (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/resources/META-INF/jboss-spring.xml 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans>
+
+ <!-- File line readers -->
+
+ <description>BeanFactory=(horoscopeContext)</description>
+
+
+ <bean id="fileLineReader" class="org.jboss.spring.samples.horoscope.spring.FileLineReader" abstract="true"/>
+
+ <bean id="randomFileLineReader"
+ class="org.jboss.spring.samples.horoscope.spring.RandomFileWordsCreator"
+ parent="fileLineReader"
+ abstract="true">
+ <property name="intCreator">
+ <ref local="javaRandomIntCreator"/>
+ </property>
+ </bean>
+
+ <!-- Randomizer beans -->
+
+ <bean id="staticWordsCreator" class="org.jboss.spring.samples.horoscope.spring.StaticWordsCreator"/>
+
+ <bean id="fileWordsCreator" parent="fileLineReader">
+ <property name="resource">
+ <value>classpath:words.properties</value>
+ </property>
+ </bean>
+
+ <bean id="randomWordsCreator" parent="randomFileLineReader">
+ <property name="resource">
+ <value>classpath:words.properties</value>
+ </property>
+ </bean>
+
+ <bean id="stateIntCreator" class="org.jboss.spring.samples.horoscope.spring.DummyStateIntCreator"/>
+
+ <bean id="javaRandomIntCreator" class="org.jboss.spring.samples.horoscope.spring.JavaRandomIntCreator"/>
+
+ <!-- Horoscope -->
+
+ <bean id="horoscopeSentenceCreator" parent="fileLineReader">
+ <property name="resource">
+ <value>classpath:horoscope.properties</value>
+ </property>
+ </bean>
+
+</beans>
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/resources/horoscope.properties
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/resources/horoscope.properties (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/resources/horoscope.properties 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,3 @@
+Lucky in cards.
+Unhappy in love.
+Short on money.
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/resources/words.properties
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/resources/words.properties (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-ejb/src/main/resources/words.properties 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,10 @@
+One
+Two
+Three
+Four
+Five
+Six
+Seven
+Eight
+Nine
+Ten
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/pom.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/pom.xml (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/pom.xml 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,59 @@
+<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>horoscope</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>horoscope-war</artifactId>
+ <packaging>war</packaging>
+ <name>horoscope-war Maven Webapp</name>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>2.5.6.SEC01</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.spring-int.samples</groupId>
+ <artifactId>horoscope-ejb</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ <type>ejb</type>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <version>2.5.6.SEC01</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ <version>3.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>taglibs</groupId>
+ <artifactId>standard</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <finalName>horoscope-war</finalName>
+ </build>
+</project>
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/java/org/jboss/tutorial/web/AppController.java
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/java/org/jboss/tutorial/web/AppController.java (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/java/org/jboss/tutorial/web/AppController.java 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.tutorial.web;
+
+import java.util.Map;
+import java.util.HashMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ejb.EJB;
+
+import org.jboss.spring.samples.horoscope.ejb.Horoscope;
+import org.jboss.spring.samples.horoscope.ejb.Randomizer;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * @author <a href="mailto:ales.justin at genera-lynx.com">Ales Justin</a>
+ */
+ at Controller
+public class AppController
+{
+
+ private @EJB(mappedName = "horoscope/RandomizerBean/local") Randomizer randomizer;
+
+ private @EJB (mappedName = "horoscope/HoroscopeBean/local") Horoscope horoscope;
+
+ public Randomizer getRandomizer()
+ {
+ return randomizer;
+ }
+
+ public void setRandomizer(Randomizer randomizer)
+ {
+ this.randomizer = randomizer;
+ }
+
+ public Horoscope getHoroscope()
+ {
+ return horoscope;
+ }
+
+ public void setHoroscope(Horoscope horoscope)
+ {
+ this.horoscope = horoscope;
+ }
+
+ @RequestMapping("/number")
+ public ModelAndView numberHandler(@RequestParam("radius") int radius)
+ throws Exception
+ {
+ return new ModelAndView("main", "number", randomizer.getNumber(radius));
+ }
+
+ @RequestMapping("/word")
+ public ModelAndView wordHandler(HttpServletRequest request, HttpServletResponse response)
+ throws Exception
+ {
+ return new ModelAndView("main", "word", randomizer.getWord());
+ }
+
+ @RequestMapping("/horoscope")
+ public Map horoscopeHandler(@RequestParam(value = "clear", required = false) String clear,
+ @RequestParam("month") int month) throws Exception
+ {
+ Map map = new HashMap();
+ if (clear != null)
+ {
+ horoscope.clear();
+ }
+ else
+ {
+ map.put("horoscope", horoscope.getHoroscope(month));
+ }
+ return map;
+ }
+
+}
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/applicationContext.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/applicationContext.xml (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/applicationContext.xml 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,11 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+ 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-2.5.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-2.5.xsd">
+
+ <context:annotation-config/>
+
+</beans>
\ No newline at end of file
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/classes/views.properties
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/classes/views.properties (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/classes/views.properties 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,2 @@
+main.class=org.springframework.web.servlet.view.JstlView
+main.url=index.jsp
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/jboss-spring-servlet.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/jboss-spring-servlet.xml (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/jboss-spring-servlet.xml 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,28 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+ 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-2.5.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-2.5.xsd">
+
+
+ <!-- <bean id="controller" class="org.jboss.tutorial.web.AppController"/>
+-->
+ <context:annotation-config/>
+ <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+ <property name="prefix" value="/WEB-INF/jsp/"/>
+ <property name="suffix" value=".jsp"/>
+ </bean>
+
+
+ <bean id="appController" class="org.jboss.tutorial.web.AppController">
+ <!-- <property name="randomizer">
+ <ref bean="randomizer"/>
+ </property>
+ <property name="horoscope">
+ <ref bean="horoscope"/>
+ </property>-->
+ </bean>
+
+</beans>
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/jsp/horoscope.jsp
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/jsp/horoscope.jsp (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/jsp/horoscope.jsp 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,3 @@
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+The prediction for this month is: <c:out value="${horoscope}"/>
\ No newline at end of file
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/web.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/WEB-INF/web.xml 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
+
+<web-app>
+
+ <display-name>JBoss-Spring-Example</display-name>
+
+ <listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>jboss-spring</servlet-name>
+ <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>jboss-spring</servlet-name>
+ <url-pattern>*.htm</url-pattern>
+ </servlet-mapping>
+
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+
+</web-app>
Added: projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/index.jsp
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/index.jsp (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/webapp/index.jsp 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1 @@
+Hello world!
\ No newline at end of file
Added: projects/spring-int/trunk/documentation/samples/horoscope/pom.xml
===================================================================
--- projects/spring-int/trunk/documentation/samples/horoscope/pom.xml (rev 0)
+++ projects/spring-int/trunk/documentation/samples/horoscope/pom.xml 2009-06-18 22:21:25 UTC (rev 90447)
@@ -0,0 +1,59 @@
+<?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>horoscope</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <modules>
+ <module>horoscope-ejb</module>
+ <module>horoscope-war</module>
+ <module>horoscope-ear</module>
+ </modules>
+ <packaging>pom</packaging>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.spring-int.samples</groupId>
+ <artifactId>horoscope-war</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.spring-int.samples</groupId>
+ <artifactId>horoscope-ejb</artifactId>
+ <version>${project.version}</version>
+ <type>ejb</type>
+ </dependency>
+<!--
+ <dependency>
+ <groupId>org.jboss.spring-int.samples</groupId>
+ <artifactId>horoscope-spring</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+-->
+ <dependency>
+ <groupId>org.jboss.spring-int.samples</groupId>
+ <artifactId>horoscope-ear</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
More information about the jboss-cvs-commits
mailing list