[webbeans-commits] Webbeans SVN: r542 - in ri/trunk/examples: translator and 21 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Wed Dec 17 09:44:00 EST 2008


Author: pete.muir at jboss.org
Date: 2008-12-17 09:43:58 -0500 (Wed, 17 Dec 2008)
New Revision: 542

Added:
   ri/trunk/examples/translator/
   ri/trunk/examples/translator/build.xml
   ri/trunk/examples/translator/pom.xml
   ri/trunk/examples/translator/webbeans-translator-ear/
   ri/trunk/examples/translator/webbeans-translator-ear/pom.xml
   ri/trunk/examples/translator/webbeans-translator-ear/src/
   ri/trunk/examples/translator/webbeans-translator-ear/src/main/
   ri/trunk/examples/translator/webbeans-translator-ear/src/main/application/
   ri/trunk/examples/translator/webbeans-translator-ear/src/main/application/META-INF/
   ri/trunk/examples/translator/webbeans-translator-ear/src/main/application/META-INF/web-beans.xml
   ri/trunk/examples/translator/webbeans-translator-ejb/
   ri/trunk/examples/translator/webbeans-translator-ejb/pom.xml
   ri/trunk/examples/translator/webbeans-translator-ejb/src/
   ri/trunk/examples/translator/webbeans-translator-ejb/src/main/
   ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/
   ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/
   ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/
   ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/
   ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/
   ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/numberguess/
   ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/numberguess/Game.java
   ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/numberguess/Generator.java
   ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/numberguess/MaxNumber.java
   ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/numberguess/Random.java
   ri/trunk/examples/translator/webbeans-translator-ejb/src/main/resources/
   ri/trunk/examples/translator/webbeans-translator-ejb/src/main/resources/META-INF/
   ri/trunk/examples/translator/webbeans-translator-war/
   ri/trunk/examples/translator/webbeans-translator-war/WebContent/
   ri/trunk/examples/translator/webbeans-translator-war/WebContent/WEB-INF/
   ri/trunk/examples/translator/webbeans-translator-war/WebContent/WEB-INF/faces-config.xml
   ri/trunk/examples/translator/webbeans-translator-war/WebContent/WEB-INF/web-beans.xml
   ri/trunk/examples/translator/webbeans-translator-war/WebContent/WEB-INF/web.xml
   ri/trunk/examples/translator/webbeans-translator-war/WebContent/home.xhtml
   ri/trunk/examples/translator/webbeans-translator-war/WebContent/index.html
   ri/trunk/examples/translator/webbeans-translator-war/WebContent/style/
   ri/trunk/examples/translator/webbeans-translator-war/WebContent/template.xhtml
   ri/trunk/examples/translator/webbeans-translator-war/pom.xml
   ri/trunk/examples/translator/webbeans-translator-war/src/
   ri/trunk/examples/translator/webbeans-translator-war/src/main/
   ri/trunk/examples/translator/webbeans-translator-war/src/main/java/
   ri/trunk/examples/translator/webbeans-translator-war/src/main/resources/
   ri/trunk/examples/translator/webbeans-translator-war/src/main/resources/META-INF/
Modified:
   ri/trunk/examples/build.xml
   ri/trunk/examples/pom.xml
Log:
add translator example

Modified: ri/trunk/examples/build.xml
===================================================================
--- ri/trunk/examples/build.xml	2008-12-17 11:37:21 UTC (rev 541)
+++ ri/trunk/examples/build.xml	2008-12-17 14:43:58 UTC (rev 542)
@@ -6,32 +6,57 @@
 	
 	<property file="${wbri.dir}/build.properties"/>
 	
+	<property name="type" value="war" />
+	
+	<condition property="war">
+		<equals arg1="${type}" arg2="war"/>
+	</condition>
+	<condition property="ear">
+      <equals arg1="${type}" arg2="ear"/>
+   </condition>
+	
+	<condition property="artifact.target.dir" value="${basedir}/target">
+		<equals arg1="${type}" arg2="war"/>
+	</condition>
+	<condition property="artifact.target.dir" value="${basedir}/${example.name}-ear/target">
+      <equals arg1="${type}" arg2="ear"/>
+   </condition>
+	
+	<property name="artifact.dir" value="${artifact.target.dir}/${example.name}" />
+	
 	<target name="package">
 		 <maven target="package" basedir="${basedir}"/>
 	</target>
 	
 	<target name="explode" depends="package">
-		<mkdir dir="${jboss.home}/server/default/deploy/${example.name}.war"/>
-		<copy todir="${jboss.home}/server/default/deploy/${example.name}.war">
-		 	<fileset dir="${basedir}/target/${example.name}" />
+		<mkdir dir="${jboss.home}/server/default/deploy/${example.name}.${type}"/>
+		<copy todir="${jboss.home}/server/default/deploy/${example.name}.${type}">
+		 	<fileset dir="${artifact.dir}" />
 		</copy>
 	</target>
 	
 	<target name="deploy" depends="package">
-		<copy todir="${jboss.home}/server/default/deploy/" file="${basedir}/target/${example.name}.war"/>
+		<copy todir="${jboss.home}/server/default/deploy/" file="${artifact.target.dir}/${example.name}.${type}"/>
 	</target>
 	
 	<target name="clean">
 		<maven target="clean" basedir="${basedir}"/>
 	</target>
 	
-	<target name="restart" depends="explode">
+	<target name="restart.war" depends="explode" if="war">
 		<touch file="${jboss.home}/server/default/deploy/${example.name}.war/WEB-INF/web.xml" />
 	</target>
 	
+	<target name="restart.ear" depends="explode" if="ear">
+      <touch file="${jboss.home}/server/default/deploy/${example.name}.ear/META-INF/application.xml" />
+   </target>
+	
+	<target name="restart" depends="restart.war, restart.ear">
+	</target>
+	
 	<target name="undeploy">
-		<delete dir="${jboss.home}/server/default/deploy/${example.name}.war" failonerror="false" />
-      <delete file="${jboss.home}/server/default/deploy/${example.name}.war" failonerror="false" />
+		<delete dir="${jboss.home}/server/default/deploy/${example.name}.${type}" failonerror="false" />
+      <delete file="${jboss.home}/server/default/deploy/${example.name}.${type}" failonerror="false" />
 	</target>
 	
   <macrodef name="maven">
@@ -56,4 +81,4 @@
       </sequential>
    </macrodef>
 	
-</project>
\ No newline at end of file
+</project>

Modified: ri/trunk/examples/pom.xml
===================================================================
--- ri/trunk/examples/pom.xml	2008-12-17 11:37:21 UTC (rev 541)
+++ ri/trunk/examples/pom.xml	2008-12-17 14:43:58 UTC (rev 542)
@@ -19,6 +19,7 @@
 
    <modules>
       <module>numberguess</module>
+      <module>translator</module>
    </modules>
 
    <build>
@@ -31,7 +32,15 @@
                   <warSourceDirectory>${basedir}/WebContent</warSourceDirectory>
                </configuration>
             </plugin>
+            <plugin>
+               <groupId>org.apache.maven.plugins</groupId>
+               <artifactId>maven-ejb-plugin</artifactId>
+               <configuration>
+                  <ejbVersion>3.0</ejbVersion>
+               </configuration>
+            </plugin>
          </plugins>
+         
       </pluginManagement>
    </build>
 

Added: ri/trunk/examples/translator/build.xml
===================================================================
--- ri/trunk/examples/translator/build.xml	                        (rev 0)
+++ ri/trunk/examples/translator/build.xml	2008-12-17 14:43:58 UTC (rev 542)
@@ -0,0 +1,8 @@
+<project basedir="." name="Numberguess Example Build" default="restart">
+	
+	<property name="example.name" value="webbeans-translator" />
+	<property name="type" value="ear" />
+
+	<import file="../build.xml" />
+	
+</project>
\ No newline at end of file

Added: ri/trunk/examples/translator/pom.xml
===================================================================
--- ri/trunk/examples/translator/pom.xml	                        (rev 0)
+++ ri/trunk/examples/translator/pom.xml	2008-12-17 14:43:58 UTC (rev 542)
@@ -0,0 +1,57 @@
+<?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/maven-v4_0_0.xsd">
+   <modelVersion>4.0.0</modelVersion>
+   <parent>
+      <groupId>org.jboss.webbeans.examples</groupId>
+      <artifactId>parent</artifactId>
+      <version>1.0.0-SNAPSHOT</version>
+   </parent>
+   <groupId>org.jboss.webbeans.examples.translator</groupId>
+   <artifactId>parent</artifactId>
+   <packaging>pom</packaging>
+   <name>Web Beans Examples: Translator (parent)</name>
+
+   <description>
+      Ear Example for the reference implementation of JSR 299: Web Beans
+   </description>
+
+   <modules>
+      <module>webbeans-translator-war</module>
+      <module>webbeans-translator-ejb</module>
+      <module>webbeans-translator-ear</module>
+   </modules>
+
+   <dependencyManagement>
+      <dependencies>
+         <dependency>
+            <groupId>org.jboss.webbeans.examples.translator</groupId>
+            <artifactId>webbeans-translator-war</artifactId>
+            <version>${webbeans.version}</version>
+            <type>war</type>
+         </dependency>
+         <dependency>
+            <groupId>org.jboss.webbeans.examples.translator</groupId>
+            <artifactId>webbeans-translator-ear</artifactId>
+            <version>${webbeans.version}</version>
+         </dependency>
+         <dependency>
+            <groupId>org.jboss.webbeans.examples.translator</groupId>
+            <artifactId>webbeans-translator-ejb</artifactId>
+            <version>${webbeans.version}</version>
+            <type>ejb</type>
+         </dependency>
+      </dependencies>
+   </dependencyManagement>
+
+   <build>
+      <pluginManagement>
+         <plugins>
+            
+         </plugins>
+      </pluginManagement>
+   </build>
+
+</project>
+

Added: ri/trunk/examples/translator/webbeans-translator-ear/pom.xml
===================================================================
--- ri/trunk/examples/translator/webbeans-translator-ear/pom.xml	                        (rev 0)
+++ ri/trunk/examples/translator/webbeans-translator-ear/pom.xml	2008-12-17 14:43:58 UTC (rev 542)
@@ -0,0 +1,82 @@
+<?xml version="1.0"?>
+<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">
+   <modelVersion>4.0.0</modelVersion>
+   
+   <parent>
+      <groupId>org.jboss.webbeans.examples.translator</groupId>
+      <artifactId>parent</artifactId>
+      <version>1.0.0-SNAPSHOT</version>
+   </parent>
+   
+   <groupId>org.jboss.webbeans.examples</groupId>
+   <artifactId>webbeans-translator-ear</artifactId>
+   <packaging>ear</packaging>
+   <name>Web Beans Examples: Translator (ear)</name>
+   
+   <pluginRepositories>
+        <pluginRepository>
+            <id>codehaus snapshot repository</id>
+            <url>http://snapshots.repository.codehaus.org/</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+        </pluginRepository>
+    </pluginRepositories>
+   
+   <dependencies>
+   
+      <dependency>
+         <groupId>org.jboss.webbeans.examples.translator</groupId>
+         <artifactId>webbeans-translator-ejb</artifactId>
+         <type>ejb</type>
+      </dependency>
+      
+      <dependency>
+         <groupId>org.jboss.webbeans.examples.translator</groupId>
+         <artifactId>webbeans-translator-war</artifactId>
+         <type>war</type>
+      </dependency>
+   
+      <dependency>
+         <groupId>org.testng</groupId>
+         <artifactId>testng</artifactId>
+         <scope>test</scope>
+         <classifier>jdk15</classifier>
+      </dependency>
+      
+      <!-- <dependency>
+         <groupId>org.jboss.el</groupId>
+         <artifactId>jboss-el</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>javax.el</groupId>
+               <artifactId>el-api</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>-->
+      
+   </dependencies>
+   
+   <build>
+      <finalName>webbeans-translator</finalName>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-ear-plugin</artifactId>
+            <configuration>
+               <modules>
+                  <webModule>
+                     <groupId>org.jboss.webbeans.examples.translator</groupId>
+                     <artifactId>webbeans-translator-war</artifactId>
+                     <contextRoot>/webbeans-translator</contextRoot>
+                  </webModule>
+               </modules>
+            </configuration>
+         </plugin>
+      </plugins>
+   </build>
+   
+</project>
+

Added: ri/trunk/examples/translator/webbeans-translator-ear/src/main/application/META-INF/web-beans.xml
===================================================================

Added: ri/trunk/examples/translator/webbeans-translator-ejb/pom.xml
===================================================================
--- ri/trunk/examples/translator/webbeans-translator-ejb/pom.xml	                        (rev 0)
+++ ri/trunk/examples/translator/webbeans-translator-ejb/pom.xml	2008-12-17 14:43:58 UTC (rev 542)
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+<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">
+   <modelVersion>4.0.0</modelVersion>
+   
+   <parent>
+      <groupId>org.jboss.webbeans.examples.translator</groupId>
+      <artifactId>parent</artifactId>
+      <version>1.0.0-SNAPSHOT</version>
+   </parent>
+   
+   <groupId>org.jboss.webbeans.examples.translator</groupId>
+   <artifactId>webbeans-translator-ejb</artifactId>
+   <packaging>ejb</packaging>
+   <name>Web Beans Examples: Translator (ejb)</name>
+   
+   <pluginRepositories>
+        <pluginRepository>
+            <id>codehaus snapshot repository</id>
+            <url>http://snapshots.repository.codehaus.org/</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+        </pluginRepository>
+    </pluginRepositories>
+   
+   <dependencies>
+      <dependency>
+         <groupId>org.testng</groupId>
+         <artifactId>testng</artifactId>
+         <scope>test</scope>
+         <classifier>jdk15</classifier>
+      </dependency>
+      
+      <dependency>
+         <groupId>org.jboss.webbeans</groupId>
+         <artifactId>webbeans-api</artifactId>
+         <scope>provided</scope>
+      </dependency>
+      
+      <dependency>
+         <groupId>javax.faces</groupId>
+         <artifactId>jsf-api</artifactId>
+         <scope>provided</scope>
+      </dependency>
+      
+   </dependencies>
+   
+   <build>
+      <finalName>webbeans-translator</finalName>
+   </build>
+   
+</project>
+

Added: ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/numberguess/Game.java
===================================================================
--- ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/numberguess/Game.java	                        (rev 0)
+++ ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/numberguess/Game.java	2008-12-17 14:43:58 UTC (rev 542)
@@ -0,0 +1,82 @@
+package org.jboss.webbeans.examples.numberguess;
+
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.webbeans.Initializer;
+import javax.webbeans.Named;
+import javax.webbeans.SessionScoped;
+
+ at Named
+ at SessionScoped
+public class Game
+{
+   private int number;
+   
+   private int guess;
+   private int smallest;
+   private int biggest;
+   private int remainingGuesses;
+   
+   public Game()
+   {
+   }
+   
+   @Initializer
+   Game(@Random int number, @MaxNumber int maxNumber)
+   {
+      this.number = number;
+      this.smallest = 1;
+      this.biggest = maxNumber;
+      this.remainingGuesses = 10;
+   }
+
+   public int getNumber()
+   {
+      return number;
+   }
+   
+   public int getGuess()
+   {
+      return guess;
+   }
+   
+   public void setGuess(int guess)
+   {
+      this.guess = guess;
+   }
+   
+   public int getSmallest()
+   {
+      return smallest;
+   }
+   
+   public int getBiggest()
+   {
+      return biggest;
+   }
+   
+   public int getRemainingGuesses()
+   {
+      return remainingGuesses;
+   }
+   
+   public String check()
+   {
+      if (guess>number)
+      {
+         biggest = guess - 1;
+      }
+      if (guess<number)
+      {
+         smallest = guess + 1;
+      }
+      if (guess == number)
+      {
+         FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Correct!"));
+      }
+      remainingGuesses--;
+      return null;
+   }
+   
+}

Added: ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/numberguess/Generator.java
===================================================================
--- ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/numberguess/Generator.java	                        (rev 0)
+++ ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/numberguess/Generator.java	2008-12-17 14:43:58 UTC (rev 542)
@@ -0,0 +1,28 @@
+package org.jboss.webbeans.examples.numberguess;
+
+
+import javax.webbeans.ApplicationScoped;
+import javax.webbeans.Produces;
+
+ at ApplicationScoped
+public class Generator {
+   
+   private java.util.Random random = new java.util.Random( System.currentTimeMillis() );
+   
+   private int maxNumber = 100;
+   
+   java.util.Random getRandom()
+   {
+      return random;
+   }
+   
+   @Produces @Random int next() { 
+      return getRandom().nextInt(maxNumber); 
+   }
+   
+   @Produces @MaxNumber int getMaxNumber()
+   {
+      return maxNumber;
+   }
+
+} 

Added: ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/numberguess/MaxNumber.java
===================================================================
--- ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/numberguess/MaxNumber.java	                        (rev 0)
+++ ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/numberguess/MaxNumber.java	2008-12-17 14:43:58 UTC (rev 542)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.examples.numberguess;
+
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+ at Target( { TYPE, METHOD, PARAMETER, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+ at BindingType
+public @interface MaxNumber
+{
+
+}

Added: ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/numberguess/Random.java
===================================================================
--- ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/numberguess/Random.java	                        (rev 0)
+++ ri/trunk/examples/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/numberguess/Random.java	2008-12-17 14:43:58 UTC (rev 542)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.examples.numberguess;
+
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+ at Target( { TYPE, METHOD, PARAMETER, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+ at BindingType
+public @interface Random
+{
+
+}

Added: ri/trunk/examples/translator/webbeans-translator-war/WebContent/WEB-INF/faces-config.xml
===================================================================
--- ri/trunk/examples/translator/webbeans-translator-war/WebContent/WEB-INF/faces-config.xml	                        (rev 0)
+++ ri/trunk/examples/translator/webbeans-translator-war/WebContent/WEB-INF/faces-config.xml	2008-12-17 14:43:58 UTC (rev 542)
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<faces-config version="1.2"
+              xmlns="http://java.sun.com/xml/ns/javaee"
+              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+    
+    <application>
+        <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+    </application>
+
+</faces-config>

Added: ri/trunk/examples/translator/webbeans-translator-war/WebContent/WEB-INF/web-beans.xml
===================================================================

Added: ri/trunk/examples/translator/webbeans-translator-war/WebContent/WEB-INF/web.xml
===================================================================
--- ri/trunk/examples/translator/webbeans-translator-war/WebContent/WEB-INF/web.xml	                        (rev 0)
+++ ri/trunk/examples/translator/webbeans-translator-war/WebContent/WEB-INF/web.xml	2008-12-17 14:43:58 UTC (rev 542)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.5"
+    xmlns="http://java.sun.com/xml/ns/javaee"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+   
+   <display-name>Web Beans Numbergues example</display-name>
+
+   <!-- JSF -->
+
+   <servlet>
+      <servlet-name>Faces Servlet</servlet-name>
+      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+      <load-on-startup>1</load-on-startup>
+   </servlet>
+
+   <servlet-mapping>
+      <servlet-name>Faces Servlet</servlet-name>
+      <url-pattern>*.jsf</url-pattern>
+   </servlet-mapping>
+   
+   <context-param>
+      <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+      <param-value>.xhtml</param-value>
+   </context-param>
+
+   <session-config>
+      <session-timeout>10</session-timeout>
+   </session-config>
+   
+    <listener>
+       <listener-class>org.jboss.webbeans.servlet.WebBeansListener</listener-class>
+    </listener>
+
+</web-app>

Added: ri/trunk/examples/translator/webbeans-translator-war/WebContent/home.xhtml
===================================================================
--- ri/trunk/examples/translator/webbeans-translator-war/WebContent/home.xhtml	                        (rev 0)
+++ ri/trunk/examples/translator/webbeans-translator-war/WebContent/home.xhtml	2008-12-17 14:43:58 UTC (rev 542)
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:ui="http://java.sun.com/jsf/facelets"
+    xmlns:h="http://java.sun.com/jsf/html"
+    xmlns:f="http://java.sun.com/jsf/core"
+    xmlns:s="http://jboss.com/products/seam/taglib">
+
+  <ui:composition template="template.xhtml">
+    <ui:define name="content">
+       <h1>Guess a number...</h1>
+       <h:form id="NumberGuessMain">
+          <div style="color: red">
+             <h:messages id="messages" globalOnly="true"/>
+             <h:outputText id="Higher" value="Higher!" rendered="#{game.number gt game.guess}"/>
+             <h:outputText id="Lower" value="Lower!" rendered="#{game.number lt game.guess}"/>
+          </div>
+   
+          <div>
+             I'm thinking of a number between #{game.smallest} and #{game.biggest}. You have #{game.remainingGuesses} guesses.
+          </div>
+     
+          <div>
+             Your guess: 
+             <h:inputText id="inputGuess" value="#{game.guess}" required="true" size="3">
+                <f:validateLongRange maximum="#{game.biggest}" minimum="#{game.smallest}"/>
+             </h:inputText>
+            <h:commandButton id="GuessButton" value="Guess" action="#{game.check}"/>
+          </div>
+   
+          <div>
+             <h:message id="message" for="inputGuess" style="color: red"/>
+          </div>
+       </h:form>
+    </ui:define>
+  </ui:composition>
+</html>

Added: ri/trunk/examples/translator/webbeans-translator-war/WebContent/index.html
===================================================================
--- ri/trunk/examples/translator/webbeans-translator-war/WebContent/index.html	                        (rev 0)
+++ ri/trunk/examples/translator/webbeans-translator-war/WebContent/index.html	2008-12-17 14:43:58 UTC (rev 542)
@@ -0,0 +1,5 @@
+<html>
+<head>
+  <meta http-equiv="Refresh" content="0; URL=home.jsf">
+</head>
+</html>
\ No newline at end of file

Added: ri/trunk/examples/translator/webbeans-translator-war/WebContent/template.xhtml
===================================================================
--- ri/trunk/examples/translator/webbeans-translator-war/WebContent/template.xhtml	                        (rev 0)
+++ ri/trunk/examples/translator/webbeans-translator-war/WebContent/template.xhtml	2008-12-17 14:43:58 UTC (rev 542)
@@ -0,0 +1,35 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:ui="http://java.sun.com/jsf/facelets"
+    xmlns:s="http://jboss.com/products/seam/taglib"
+    xmlns:h="http://java.sun.com/jsf/html"
+    xmlns:f="http://java.sun.com/jsf/core">
+
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <title>Numberguess</title>
+  <link href="style/main.css" rel="stylesheet" type="text/css"/>
+  <ui:insert name="head"/>
+</head>
+
+<body>
+  
+  <div id="container">
+    <div id="header">
+  
+    </div>
+
+    <div id="sidebar">
+    
+    </div>
+  
+    <div id="content">
+      <ui:insert name="content"/>
+    </div>
+    
+    <br style="clear:both"/>
+  </div>
+   
+</body>
+</html>
+

Added: ri/trunk/examples/translator/webbeans-translator-war/pom.xml
===================================================================
--- ri/trunk/examples/translator/webbeans-translator-war/pom.xml	                        (rev 0)
+++ ri/trunk/examples/translator/webbeans-translator-war/pom.xml	2008-12-17 14:43:58 UTC (rev 542)
@@ -0,0 +1,76 @@
+<?xml version="1.0"?>
+<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">
+   <modelVersion>4.0.0</modelVersion>
+   
+   <parent>
+      <groupId>org.jboss.webbeans.examples.translator</groupId>
+      <artifactId>parent</artifactId>
+      <version>1.0.0-SNAPSHOT</version>
+   </parent>
+   
+   <groupId>org.jboss.webbeans.examples.translator</groupId>
+   <artifactId>webbeans-translator-war</artifactId>
+   <packaging>war</packaging>
+   <name>Web Beans Examples: Translator (war)</name>
+   
+   <pluginRepositories>
+        <pluginRepository>
+            <id>codehaus snapshot repository</id>
+            <url>http://snapshots.repository.codehaus.org/</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+        </pluginRepository>
+    </pluginRepositories>
+   
+   <dependencies>
+      <dependency>
+         <groupId>org.testng</groupId>
+         <artifactId>testng</artifactId>
+         <scope>test</scope>
+         <classifier>jdk15</classifier>
+      </dependency>
+      
+      <dependency>
+         <groupId>javax.faces</groupId>
+         <artifactId>jsf-api</artifactId>
+         <scope>provided</scope>
+      </dependency>
+      
+      <dependency>
+        <groupId>com.sun.facelets</groupId>
+        <artifactId>jsf-facelets</artifactId>
+      </dependency>
+      
+      <!-- <dependency>
+         <groupId>org.jboss.el</groupId>
+         <artifactId>jboss-el</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>javax.el</groupId>
+               <artifactId>el-api</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>-->
+      
+      <dependency>
+         <groupId>javax.el</groupId>
+         <artifactId>el-ri</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>javax.el</groupId>
+               <artifactId>el-api</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      
+   </dependencies>
+   
+   <build>
+      <finalName>webbeans-translator</finalName>
+   </build>
+   
+</project>
+




More information about the weld-commits mailing list