Java Reference
In-Depth Information
errorMessage = e.getLocalizedMessage();
e = e.getCause();
}
return errorMessage;
}
}
The TicketController class is due to complete the following tasks:
1. At first it produces a SeatType object [1] and exposes it to the JSF
View layer using the @Named annotation.
Note
This technique is a great addition provided by CDI since it removes
the need to create a boilerplate object, SeatType , to transport the in-
formation from the view to the services. The SeatType object is pro-
duced by the controller and will be populated by the JSF view and
persisted by the TicketService .
2. Next, it is used to demarcate the user's conversation [2] by starting it
once you've done with your theatre setup and you have chosen to restart
the application [3].
3. It then drives user navigation between the application screens by return-
ing to the home page [4].
Note
As you can see from the restart method, JSF 2 supports implicit
navigation , which means that you don't need to define navigation
rules inside the JSF configuration file. You can simply return the page
name (for example, book ) from your methods (or set it in your form
Search WWH ::




Custom Search