Java Reference
In-Depth Information
An identification page with JSF
The following code shows an example of a JSF page to enter personal information,
such as first name and nationality. It also contains components for selection lists and
checkboxes. As you can see, it is not necessary to be a geek to make a good job.
To manage the navigation after validation of parameters, we use the action attrib-
ute of the commandButton component that expects a return value from the method
onclickValidateListener . The web page that follows displays relative to the
value returned and is defined in the faces-config.xml file of the web application.
<?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"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
<title>Online pre-registration
site</title>
</h:head>
<h:body>
<f:view>
<h:form >
<dir align="center" >
<h:panelGrid columns="2"
style="border: solid blue">
<h:outputText
value="First name : " />
<h:inputText
value="#{studentBean.firstName}" />
<h:outputText
value="Last name : " />
<h:inputSecret
value="#{studentBean.lastName}" />
<h:outputText
Search WWH ::




Custom Search