Java Reference
In-Depth Information
We need to make sure the name the new file matches the value of the action attribute
in the command button of the input page ( confirmation.xhtml ) so that static
navigation works properly.
After modifying the generated page to meet our requirements, it should look
like this:
<?xml version='1.0' encoding='UTF-8' ?>
<!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:h="http://xmlns.jcp.org/jsf/html">
<h:head>
<title>Confirmation Page</title>
<h:outputStylesheet library="css" name="styles.css"/>
</h:head>
<h:body>
<h2>Confirmation Page</h2>
<h:panelGrid columns="2"
columnClasses="rightalign-bold,leftalign">
<h:outputText value="Salutation:"/>
${registrationBean.salutation}
<h:outputText value="First Name:"/>
${registrationBean.firstName}
<h:outputText value="Last Name:"/>
${registrationBean.lastName}
<h:outputText value="Age:"/>
${registrationBean.age}
<h:outputText value="Email Address:"/>
${registrationBean.email}
</h:panelGrid>
</h:body>
</html>
As we can see, our confirmation page is very simple. It consists of a series of
<h:outputText> tags that contain labels and value binding expressions bound
to our named bean's properties. The JSF <h:outputText> tag simply displays
the value of the expression of its value attribute on the rendered page.
Executing our application
We are now ready to execute our JSF application. The easiest way to do so is to
right-click on our project and click on Run in the resulting pop-up menu.
 
Search WWH ::




Custom Search