Your First Cup: An Introduction to the Java EE Platform

ProcedureAdding the Form to response.html

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

    <h:form>
        <h:outputText value="#{bundle.YouAre} "/>
        <h:outputText value="#{bundle.SameAge}"
                      rendered="#{dukesBDay.ageDiff == 0}"/>
        <h:outputText value="#{dukesBDay.absAgeDiff}"
                      rendered="#{dukesBDay.ageDiff lt 0}"/>
        <h:outputText value=" #{bundle.Year} "
                      rendered="#{dukesBDay.ageDiff == -1}"/>
        <h:outputText value=" #{bundle.Years} "
                      rendered="#{dukesBDay.ageDiff lt -1}"/>
        <h:outputText value="#{bundle.Younger}"
                      rendered="#{dukesBDay.ageDiff lt 0}"/>
        <h:outputText value="#{dukesBDay.absAgeDiff}"
                      rendered="#{dukesBDay.ageDiff gt 0}"/>
        <h:outputText value=" #{bundle.Year} "
                      rendered="#{dukesBDay.ageDiff == 1}"/>
        <h:outputText value=" #{bundle.Years} "
                      rendered="#{dukesBDay.ageDiff gt 1}"/>
        <h:outputText value="#{bundle.Older}" rendered="#{dukesBDay.ageDiff gt 0}"/>    <p/>
        <h:commandButton id="back" value="#{bundle.Back}" action="greeting"/>
    </h:form>
  2. Right-click in the editor window and select Format.

  3. Select File->Save.