Java Reference
In-Depth Information
For this project, you need to create three JSF pages named AddressRegistration.xhtml,
ConfirmAddress.xhtml, AddressStoredStatus.xhtml in Listings 33.16-33.18. The project
starts with AddressRegistration.xhtml. When clicking the
Submit
button, the action for the
button returns ”ConfirmAddress” if the last name and first name are not empty, which causes
ConfirmAddress.xhtml to be displayed. When clicking the
Confirm
button, the status page
AddressStoredStatus is displayed. When clicking the
Go Back
button, the first page Address-
Registration is now displayed.
L
ISTING
33.16
AddressRegistration.xhtml
1 <?xml version='1.0' encoding='UTF-8' ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml"
5 xmlns:h="http://xmlns.jcp.org/jsf/html"
6 xmlns:f="http://xmlns.jcp.org/jsf/core">
7 <h:head>
8 <title>Student Registration Form</title>
9 </h:head>
10 <h:body>
11 <h:form>
12 <!-- Use h:graphicImage -->
13 <h3>Student Registration Form
14 <h:graphicImage name="usIcon.gif" library="image"/>
15 </h3>
16
17 Please register to your instructor's student address book.
18 <!-- Use h:panelGrid -->
19 <h:panelGrid columns="6">
20 <h:outputLabel value="Last Name" style="color:red"/>
21 <h:inputText id="lastNameInputText"
22 value="#{addressRegistration.lastName}"/>
23 <h:outputLabel value="First Name" style="color:red"/>
24 <h:inputText id="firstNameInputText"
25 value="#{addressRegistration.firstName}"/>
26 <h:outputLabel value="MI" />
27 <h:inputText id="miInputText" size="1"
28 value="#{addressRegistration.mi}"/>
29 </h:panelGrid>
30
31 <h:panelGrid columns="4">
32 <h:outputLabel value="Telephone"/>
33 <h:inputText id="telephoneInputText"
34 value="#{addressRegistration.telephone}"/>
35 <h:outputLabel value="Email"/>
36 <h:inputText id="emailInputText"
37 value="#{addressRegistration.email}"/>
38 </h:panelGrid>
39
40 <h:panelGrid columns="4">
41 <h:outputLabel value="Street"/>
42 <h:inputText id="streetInputText"
43 value="#{addressRegistration.street}"/>
44 </h:panelGrid>
45
46 <h:panelGrid columns="6">
47 <h:outputLabel value="City"/>
48 <h:inputText id="cityInputText"
49 value="#{addressRegistration.city}"/>
jsf core namespace
bind
lastName
bind
firstName
bind
mi
bind
telephone
bind
email
bind
street
bind
city
Search WWH ::
Custom Search