Java Reference
In-Depth Information
Just as with other JSF applications, CDI applications use facelets as their view
technology. The following example illustrates a typical markup for a JSF page
using CDI:
<?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>Create New Customer</title>
</h:head>
<h:body>
<h:form>
<h3>Create New Customer</h3>
<h:panelGrid columns="3">
<h:outputLabel for="firstName" value="First Name"/>
<h:inputText id="firstName" value="#{customer.
firstName}"/>
<h:message for="firstName"/>
<h:outputLabel for="middleName" value="Middle Name"/>
<h:inputText id="middleName"
value="#{customer.middleName}"/>
<h:message for="middleName"/>
<h:outputLabel for="lastName" value="Last Name"/>
<h:inputText id="lastName" value="#{customer.
lastName}"/>
<h:message for="lastName"/>
<h:outputLabel for="email" value="Email Address"/>
<h:inputText id="email" value="#{customer.email}"/>
<h:message for="email"/>
<h:panelGroup/>
<h:commandButton value="Submit"
action="#{customerController.
navigateToConfirmation}"/>
</h:panelGrid>
</h:form>
</h:body>
</html>
 
Search WWH ::




Custom Search