Your First Cup: An Introduction to the Java EE Platform

ProcedureAdding the Form to greeting.xhtml

Add the form that provides the user interface for displaying Duke's age and entering the user's birthday.

  1. In the firstcup project in greeting.xhtml add the following tags between the <body> and </body> tags.

            <h:outputText value="#{bundle.Welcome}"/>
        <h:outputText value="#{bundle.DukeIs} "/>
        <h:outputText value="#{dukesBDay.age} #{bundle.YearsOldToday}"/>
        <h:outputText value="#{bundle.Instructions}"/>
        <h:outputText value="#{bundle.YourBD} "/>
        <fc:inputDate id="userBirthday" date="#{dukesBDay.yourBD}" />
        <h:outputText value=" #{bundle.Pattern}"/>
        <h:commandButton value="#{bundle.Submit}" action="response"/>
        <h:message for="userBirthday" style="color:red"/>
  2. Right-click in the editor window and select Format.

  3. Select File->Save.