[seam-commits] Seam SVN: r15238 - in branches/community/Seam_2_3/examples/drools: drools-tests/src/test/java/org/jboss/seam/example/numberguess/test and 4 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Oct 9 10:01:51 EDT 2012


Author: maschmid
Date: 2012-10-09 10:01:50 -0400 (Tue, 09 Oct 2012)
New Revision: 15238

Added:
   branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/lose.xhtml
   branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/numberGuess.xhtml
   branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/win.xhtml
Removed:
   branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/lose.jsp
   branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/numberGuess.jsp
   branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/win.jsp
Modified:
   branches/community/Seam_2_3/examples/drools/drools-ear/src/main/application/pageflow.jpdl.xml
   branches/community/Seam_2_3/examples/drools/drools-tests/src/test/java/org/jboss/seam/example/numberguess/test/DroolsNumberGuessTest.java
   branches/community/Seam_2_3/examples/drools/drools-tests/src/test/resources-integration/web.xml
   branches/community/Seam_2_3/examples/drools/drools-web/pom.xml
   branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/WEB-INF/web.xml
Log:
upgrade drools example to facelets


Modified: branches/community/Seam_2_3/examples/drools/drools-ear/src/main/application/pageflow.jpdl.xml
===================================================================
--- branches/community/Seam_2_3/examples/drools/drools-ear/src/main/application/pageflow.jpdl.xml	2012-10-09 11:23:17 UTC (rev 15237)
+++ branches/community/Seam_2_3/examples/drools/drools-ear/src/main/application/pageflow.jpdl.xml	2012-10-09 14:01:50 UTC (rev 15238)
@@ -11,7 +11,7 @@
 	    "http://jboss.org/schema/seam/pageflow http://jboss.org/schema/seam/pageflow-2.3.xsd" 
 	name="numberGuess">
    
-   <start-page name="displayGuess" view-id="/numberGuess.jsp">
+   <start-page name="displayGuess" view-id="/numberGuess.xhtml">
       <redirect/>
       <transition name="guess" to="drools"/>
    </start-page>
@@ -34,12 +34,12 @@
       
    </decision>
    
-   <page name="win" view-id="/win.jsp">
+   <page name="win" view-id="/win.xhtml">
    	  <end-conversation />
       <redirect/>
    </page>
    
-   <page name="lose" view-id="/lose.jsp">
+   <page name="lose" view-id="/lose.xhtml">
       <end-conversation />
       <redirect/>
    </page>

Modified: branches/community/Seam_2_3/examples/drools/drools-tests/src/test/java/org/jboss/seam/example/numberguess/test/DroolsNumberGuessTest.java
===================================================================
--- branches/community/Seam_2_3/examples/drools/drools-tests/src/test/java/org/jboss/seam/example/numberguess/test/DroolsNumberGuessTest.java	2012-10-09 11:23:17 UTC (rev 15237)
+++ branches/community/Seam_2_3/examples/drools/drools-tests/src/test/java/org/jboss/seam/example/numberguess/test/DroolsNumberGuessTest.java	2012-10-09 14:01:50 UTC (rev 15238)
@@ -46,7 +46,7 @@
    @Test
    public void testNumberGuessWin() throws Exception
    {
-      String id = new NonFacesRequest("/numberGuess.jsp")
+      String id = new NonFacesRequest("/numberGuess.xhtml")
       {
 
          @Override
@@ -64,7 +64,7 @@
          
       }.run();
 
-      String id2 = new FacesRequest("/numberGuess.jsp", id)
+      String id2 = new FacesRequest("/numberGuess.xhtml", id)
       {
 
          @Override
@@ -83,14 +83,14 @@
          @Override
          protected void afterRequest() {
             assert !isRenderResponseBegun();
-            assert getViewId().equals("/numberGuess.jsp");
+            assert getViewId().equals("/numberGuess.xhtml");
          }
          
       }.run();
       
       assert id2.equals(id);
       
-      new NonFacesRequest("/numberGuess.jsp", id)
+      new NonFacesRequest("/numberGuess.xhtml", id)
       {
          
          @Override
@@ -108,7 +108,7 @@
          
       }.run();
 
-      id2 = new FacesRequest("/numberGuess.jsp", id)
+      id2 = new FacesRequest("/numberGuess.xhtml", id)
       {
 
          @Override
@@ -132,14 +132,14 @@
          protected void afterRequest()
          {
             assert !isRenderResponseBegun();
-            assert getViewId().equals("/win.jsp");
+            assert getViewId().equals("/win.xhtml");
          }
          
       }.run();
       
       assert id2.equals(id);
       
-      new NonFacesRequest("/win.jsp", id)
+      new NonFacesRequest("/win.xhtml", id)
       {
          @Override
          protected void renderResponse() throws Exception {
@@ -159,7 +159,7 @@
    @Test
    public void testNumberGuessLose() throws Exception
    {
-      String id = new NonFacesRequest("/numberGuess.jsp")
+      String id = new NonFacesRequest("/numberGuess.xhtml")
       {
 
          @Override
@@ -180,7 +180,7 @@
          
          final int count = i;
 
-         new FacesRequest("/numberGuess.jsp", id)
+         new FacesRequest("/numberGuess.xhtml", id)
          {
    
             @Override
@@ -202,12 +202,12 @@
             protected void afterRequest()
             {
                assert !isRenderResponseBegun();
-               assert getViewId().equals("/numberGuess.jsp");
+               assert getViewId().equals("/numberGuess.xhtml");
             }
             
          }.run();
          
-         new NonFacesRequest("/numberGuess.jsp", id)
+         new NonFacesRequest("/numberGuess.xhtml", id)
          {
    
             @Override
@@ -227,7 +227,7 @@
       
       }
 
-      new FacesRequest("/numberGuess.jsp", id)
+      new FacesRequest("/numberGuess.xhtml", id)
       {
 
          @Override
@@ -249,12 +249,12 @@
          protected void afterRequest()
          {
             assert !isRenderResponseBegun();
-            assert getViewId().equals("/lose.jsp");
+            assert getViewId().equals("/lose.xhtml");
          }
          
       }.run();
 
-      new NonFacesRequest("/lose.jsp", id)
+      new NonFacesRequest("/lose.xhtml", id)
       {
 
          @Override

Modified: branches/community/Seam_2_3/examples/drools/drools-tests/src/test/resources-integration/web.xml
===================================================================
--- branches/community/Seam_2_3/examples/drools/drools-tests/src/test/resources-integration/web.xml	2012-10-09 11:23:17 UTC (rev 15237)
+++ branches/community/Seam_2_3/examples/drools/drools-tests/src/test/resources-integration/web.xml	2012-10-09 14:01:50 UTC (rev 15238)
@@ -9,9 +9,4 @@
         <listener-class>org.jboss.seam.mock.MockSeamListener</listener-class>
     </listener>
 
-    <context-param>
-        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
-        <param-value>.jsp</param-value>
-    </context-param>
-
 </web-app>

Modified: branches/community/Seam_2_3/examples/drools/drools-web/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples/drools/drools-web/pom.xml	2012-10-09 11:23:17 UTC (rev 15237)
+++ branches/community/Seam_2_3/examples/drools/drools-web/pom.xml	2012-10-09 14:01:50 UTC (rev 15238)
@@ -40,6 +40,16 @@
                 </exclusion>
             </exclusions>
         </dependency>
+        <dependency>
+            <groupId>org.jboss.spec.javax.faces</groupId>
+            <artifactId>jboss-jsf-api_2.1_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.spec.javax.servlet</groupId>
+            <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 
     <build>

Modified: branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/WEB-INF/web.xml	2012-10-09 11:23:17 UTC (rev 15237)
+++ branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/WEB-INF/web.xml	2012-10-09 14:01:50 UTC (rev 15238)
@@ -40,7 +40,7 @@
       
     <context-param>
         <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
-        <param-value>.jsp</param-value>
+        <param-value>.xhtml</param-value>
     </context-param>
     
 </web-app>

Deleted: branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/lose.jsp
===================================================================
--- branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/lose.jsp	2012-10-09 11:23:17 UTC (rev 15237)
+++ branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/lose.jsp	2012-10-09 14:01:50 UTC (rev 15238)
@@ -1,15 +0,0 @@
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<html>
-<head>
-<title>You lose.</title>
-</head>
-<body>
-<h1>You lose.</h1>
-<f:view>
-    We recommend the 
-    <a href="http://mathworld.wolfram.com/Bisection.html">bisection algorithm</a>.
-    Would you like to <a href="numberGuess.seam">play again</a>?
-  </f:view>
-</body>
-</html>

Added: branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/lose.xhtml
===================================================================
--- branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/lose.xhtml	                        (rev 0)
+++ branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/lose.xhtml	2012-10-09 14:01:50 UTC (rev 15238)
@@ -0,0 +1,16 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<h: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.org/schema/seam/taglib">
+<h:head>
+<title>You lose.</title>
+</h:head>
+<h:body>
+<h1>You lose.</h1>
+    We recommend the 
+    <a href="http://mathworld.wolfram.com/Bisection.html">bisection algorithm</a>.
+    Would you like to <a href="numberGuess.seam">play again</a>
+</h:body>
+</h:html>

Deleted: branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/numberGuess.jsp
===================================================================
--- branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/numberGuess.jsp	2012-10-09 11:23:17 UTC (rev 15237)
+++ branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/numberGuess.jsp	2012-10-09 14:01:50 UTC (rev 15238)
@@ -1,29 +0,0 @@
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<html>
-<head>
-<title>Guess a number...</title>
-</head>
-<body>
-<h1>Guess a number...</h1>
-<f:view>
-	<h:form id="NumberGuessMain">
-	    <h:outputText value="Higher!" rendered="#{randomNumber>guess.value}" />
-	    <h:outputText value="Lower!" rendered="#{randomNumber<guess.value}" />
-		<br />
-        I'm thinking of a number between <h:outputText id="Smallest" value="#{game.smallest}" /> and 
-        <h:outputText id="Biggest" value="#{game.biggest}" />.
-        <br />
-        Your guess: 
-        <h:inputText value="#{guess.value}" id="inputGuess" required="true">
-            <f:validateLongRange
-                maximum="#{game.biggest}" 
-                minimum="#{game.smallest}"/>
-        </h:inputText>
-		<h:commandButton id="GuessButton" type="submit" value="Guess" action="guess" />
-		<br/>
-        <h:message for="guess" style="color: red"/>
-	</h:form>
-</f:view>
-</body>
-</html>

Added: branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/numberGuess.xhtml
===================================================================
--- branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/numberGuess.xhtml	                        (rev 0)
+++ branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/numberGuess.xhtml	2012-10-09 14:01:50 UTC (rev 15238)
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<h: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.org/schema/seam/taglib">
+<h:head>
+<title>Guess a number...</title>
+</h:head>
+<h:body>
+<h1>Guess a number...</h1>
+	<h:form id="NumberGuessMain">
+	    <h:outputText value="Higher!" rendered="#{randomNumber gt guess.value}" />
+	    <h:outputText value="Lower!" rendered="#{randomNumber lt guess.value}" />
+		<br />
+        I'm thinking of a number between <h:outputText id="Smallest" value="#{game.smallest}" /> and 
+        <h:outputText id="Biggest" value="#{game.biggest}" />.
+        <br />
+        Your guess: 
+        <h:inputText value="#{guess.value}" id="inputGuess" required="true">
+            <f:validateLongRange
+                maximum="#{game.biggest}" 
+                minimum="#{game.smallest}"/>
+        </h:inputText>
+		<h:commandButton id="GuessButton" type="submit" value="Guess" action="guess">
+			<!-- Workaround for JBSEAM-4976 -->
+            <s:conversationId/>
+        </h:commandButton>
+		<br/>
+        <h:message for="inputGuess" style="color: red"/>
+	</h:form>
+</h:body>
+</h:html>

Deleted: branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/win.jsp
===================================================================
--- branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/win.jsp	2012-10-09 11:23:17 UTC (rev 15237)
+++ branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/win.jsp	2012-10-09 14:01:50 UTC (rev 15238)
@@ -1,15 +0,0 @@
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<html>
-<head>
-<title>You won!</title>
-</head>
-<body>
-<h1>You won!</h1>
-<f:view>
-    Yes, the answer was <h:outputText value="#{randomNumber}" />.
-    It took you <h:outputText value="#{game.guessCount}" /> guesses.
-    Would you like to <a href="numberGuess.seam">play again</a>?
-  </f:view>
-</body>
-</html>

Added: branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/win.xhtml
===================================================================
--- branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/win.xhtml	                        (rev 0)
+++ branches/community/Seam_2_3/examples/drools/drools-web/src/main/webapp/win.xhtml	2012-10-09 14:01:50 UTC (rev 15238)
@@ -0,0 +1,16 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<h: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.org/schema/seam/taglib">
+<h:head>
+<title>You won!</title>
+</h:head>
+<h:body>
+<h1>You won!</h1>
+    Yes, the answer was <h:outputText value="#{randomNumber}" />.
+    It took you <h:outputText value="#{game.guessCount}" /> guesses.
+    Would you like to <a href="numberGuess.seam">play again</a>?
+</h:body>
+</h:html>



More information about the seam-commits mailing list