alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Java EE 6 example source code file (home.xhtml)

This example Java EE 6 source code file (home.xhtml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Java EE 6 tags/keywords

by, doctype, guess, guess, higher, higher, lower, lower, number, number, restartbutton, transitional//en, w3c//dtd, weld

The Java EE 6 home.xhtml source code

<!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">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>JSF 2.0 Weld Example
    </h:head>

    <h:body>
       <h:form id="NumberGuessMain">
          <h:panelGrid styleClass="title-panel">
             <h:outputText value="Guess Number" styleClass="title-panel-text"/>
             <h:outputText value="Powered By JavaServer Faces 2.0 and Weld" styleClass="title-panel-subtext"/>
          </h:panelGrid>

          <div style="color: black; font-size: 24px;">
             I'm thinking of a number between <span style="color: blue">#{game.smallest} and #{game.biggest}. You have #{game.remainingGuesses} guesses.
          </div>
     
          <h:panelGrid border="1" columns="5" style="font-size: 18px;">
             Number: 
             <h:inputText id="inputGuess" value="#{game.guess}" required="true" size="3" disabled="#{game.number eq game.guess}" 
		validator="#{game.validateNumberRange}">
             </h:inputText>
             <h:commandButton id="GuessButton" value="Guess" action="#{game.check}" disabled="#{game.number eq game.guess}"/>
             <h:commandButton id="RestartButton" value="Reset" action="#{game.reset}" immediate="true" />
             <h:outputText id="Higher" value="Higher!" rendered="#{game.number gt game.guess and game.guess ne 0}" style="color: red"/>
             <h:outputText id="Lower" value="Lower!" rendered="#{game.number lt game.guess and game.guess ne 0}" style="color: red"/>
          </h:panelGrid>

          <div style="color: red; font-size: 14px;">
             <h:messages id="messages" globalOnly="false"/>
          </div>

          <h:outputStylesheet name="stylesheet.css" />
       </h:form>
    </h:body>

</html>

Other Java EE 6 examples (source code examples)

Here is a short list of links related to this Java EE 6 home.xhtml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.