[jboss-cvs] jboss-seam/examples/numberguess/view ...

Gavin King gavin.king at jboss.com
Thu Jul 13 23:05:38 EDT 2006


  User: gavin   
  Date: 06/07/13 23:05:38

  Modified:    examples/numberguess/view    lose.jsp numberGuess.jsp
                        win.jsp
  Log:
  make it work on ie, and ditch jsp:root
  
  Revision  Changes    Path
  1.3       +12 -15    jboss-seam/examples/numberguess/view/lose.jsp
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: lose.jsp
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/numberguess/view/lose.jsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- lose.jsp	13 Jul 2006 18:08:31 -0000	1.2
  +++ lose.jsp	14 Jul 2006 03:05:38 -0000	1.3
  @@ -1,20 +1,17 @@
   <?xml version="1.0"?>
  -<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
  -          xmlns:f="http://java.sun.com/jsf/core"
  -          xmlns="http://www.w3.org/1999/xhtml"
  -          version="1.2">
  -<jsp:directive.page contentType="text/html;charset=utf-8"/>
  -<html>
  -<head>
  -<title>You lose.</title>
  -</head>
  -<body>
  -<h1>You lose.</h1>
  -<f:view>
  +<html xmlns:jsp="http://java.sun.com/JSP/Page"
  +      xmlns="http://www.w3.org/1999/xhtml">
  +  <jsp:output doctype-root-element="html"
  +              doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  +              doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
  +  <jsp:directive.page contentType="text/html"/>
  +  <head>
  +    <title>You lose.</title>
  +  </head>
  +  <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>?
  -  </f:view>
  -</body>
  +  </body>
   </html>
  -</jsp:root>
  
  
  
  1.4       +29 -28    jboss-seam/examples/numberguess/view/numberGuess.jsp
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: numberGuess.jsp
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/numberguess/view/numberGuess.jsp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- numberGuess.jsp	13 Jul 2006 18:08:31 -0000	1.3
  +++ numberGuess.jsp	14 Jul 2006 03:05:38 -0000	1.4
  @@ -1,37 +1,38 @@
   <?xml version="1.0"?>
  -<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" 
  +<html xmlns:jsp="http://java.sun.com/JSP/Page" 
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:f="http://java.sun.com/jsf/core"
  -          xmlns="http://www.w3.org/1999/xhtml"
  -          version="1.2">
  -<jsp:directive.page contentType="text/html;charset=utf-8"/>
  -<html>
  -<head>
  -<title>Guess a number...</title>
  -</head>
  -<body>
  -<h1>Guess a number...</h1>
  -<f:view>
  +      xmlns="http://www.w3.org/1999/xhtml">
  +  <jsp:output doctype-root-element="html"
  +              doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  +              doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
  +  <jsp:directive.page contentType="text/html"/>
  +  <head>
  +    <title>Guess a number...</title>
  +  </head>
  +  <body>
  +    <h1>Guess a number...</h1>
  +    <f:view>
   	<h:form>
  -	    <h:messages globalOnly="true" />
  -	    <h:outputText value="Higher!" rendered="#{numberGuess.randomNumber gt numberGuess.currentGuess}" />
  -	    <h:outputText value="Lower!" rendered="#{numberGuess.randomNumber lt numberGuess.currentGuess}" />
  +	    <h:messages globalOnly="true"/>
  +	    <h:outputText value="Higher!" 
  +	                  rendered="#{numberGuess.randomNumber gt numberGuess.currentGuess}"/>
  +	    <h:outputText value="Lower!" 
  +	                  rendered="#{numberGuess.randomNumber lt numberGuess.currentGuess}"/>
   		<br />
  -        I'm thinking of a number between <h:outputText value="#{numberGuess.smallest}" /> and 
  -        <h:outputText value="#{numberGuess.biggest}" />. You have 
  -        <h:outputText value="#{numberGuess.remainingGuesses}" /> guesses.
  +        I'm thinking of a number between <h:outputText value="#{numberGuess.smallest}"/> and 
  +        <h:outputText value="#{numberGuess.biggest}"/>. You have 
  +        <h:outputText value="#{numberGuess.remainingGuesses}"/> guesses.
           <br />
           Your guess: 
           <h:inputText value="#{numberGuess.currentGuess}" id="guess" required="true">
  -            <f:validateLongRange
  -                maximum="#{numberGuess.biggest}" 
  +          <f:validateLongRange maximum="#{numberGuess.biggest}" 
                   minimum="#{numberGuess.smallest}"/>
           </h:inputText>
  -		<h:commandButton type="submit" value="Guess" action="guess" />
  +		<h:commandButton type="submit" value="Guess" action="guess"/>
   		<br/>
           <h:message for="guess" style="color: red"/>
   	</h:form>
  -</f:view>
  -</body>
  +    </f:view>
  +  </body>
   </html>
  -</jsp:root>
  
  
  
  1.3       +19 -19    jboss-seam/examples/numberguess/view/win.jsp
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: win.jsp
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/numberguess/view/win.jsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- win.jsp	13 Jul 2006 18:08:31 -0000	1.2
  +++ win.jsp	14 Jul 2006 03:05:38 -0000	1.3
  @@ -1,21 +1,21 @@
   <?xml version="1.0"?>
  -<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" 
  +<html xmlns:jsp="http://java.sun.com/JSP/Page" 
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:f="http://java.sun.com/jsf/core"
  -          xmlns="http://www.w3.org/1999/xhtml"
  -          version="1.2">
  -<jsp:directive.page contentType="text/html;charset=utf-8"/>
  -<html>
  -<head>
  -<title>You won!</title>
  -</head>
  -<body>
  -<h1>You won!</h1>
  -<f:view>
  +      xmlns="http://www.w3.org/1999/xhtml">
  +  <jsp:output doctype-root-element="html"
  +              doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  +              doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
  +  <jsp:directive.page contentType="text/html"/>
  +  <head>
  +    <title>You won!</title>
  +  </head>
  +  <body>
  +    <h1>You won!</h1>
  +    <f:view>
       Yes, the answer was <h:outputText value="#{numberGuess.currentGuess}" />.
       It took you <h:outputText value="#{numberGuess.guessCount}" /> guesses.
       Would you like to <a href="numberGuess.seam">play again</a>?
     </f:view>
  -</body>
  +  </body>
   </html>
  -</jsp:root>
  
  
  



More information about the jboss-cvs-commits mailing list