Java Reference
In-Depth Information
The first thing we need to do is add an <h:form> tag to our page. The <h:form> tag
is equivalent to the <form> tag in standard HTML pages. After typing the first few
characters of the <h:form> tag into the page, and hitting Ctrl+Space , we can take
advantage of NetBeans' excellent code completion.
After adding the <h:form> tag and a number of additional JSF tags, our page now
looks like this:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns=""
<h:outputStylesheet library="css" name="styles.css"/>
<h3>Registration Page</h3>
<h:panelGrid columns="3"
<h:outputLabel value="Salutation: " for="salutation"/>
<h:selectOneMenu id="salutation" label="Salutation"
value="#{registrationBean.salutation}" >
<f:selectItem itemLabel="" itemValue=""/>
<f:selectItem itemLabel="Mr." itemValue="MR"/>
<f:selectItem itemLabel="Mrs." itemValue="MRS"/>
<f:selectItem itemLabel="Miss" itemValue="MISS"/>
<f:selectItem itemLabel="Ms" itemValue="MS"/>
<f:selectItem itemLabel="Dr." itemValue="DR"/>
<h:message for="salutation"/>
<h:outputLabel value="First Name:" for="firstName"/>
<h:inputText id="firstName" label="First Name"
value="#{registrationBean.firstName}" />
<h:message for="firstName" />
<h:outputLabel value="Last Name:" for="lastName"/>
<h:inputText id="lastName" label="Last Name"
value="#{registrationBean.lastName}" />
Search WWH ::

Custom Search