Java Reference
In-Depth Information
In the above class, an instance of the Customer class is injected at runtime, this is
accomplished via the @Inject annotation, this annotation allows us to easily use
dependency injection in CDI applications.
The navigateToConfirmation() method in the above class is invoked when the
user clicks on the Submit button on the page. navigateToConfirmation() works
just like an equivalent method in a JSF managed bean would, that is, it returns
a string, and based on the value of this string the application navigates to an
appropriate page. Just like with JSF, by default the target page's name is the return
value of this method plus an XHTML extension. For example, if no exceptions are
thrown in the navigateToConfirmation() method, the user is directed to a page
named confirmation.xhtml .
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns=""
New Customer created successfully.
<h:panelGrid columns="2" border="1" cellspacing="0">
<h:outputLabel for="firstName" value="First Name"/>
<h:outputText id="firstName" value="#{customer.
<h:outputLabel for="middleName" value="Middle Name"/>
<h:outputText id="middleName" value="#{customer.
<h:outputLabel for="lastName" value="Last Name"/>
<h:outputText id="lastName" value="#{customer.lastName}"/>
<h:outputLabel for="email" value="Email Address"/>
<h:outputText id="email" value="#{}"/>
Search WWH ::

Custom Search