Java Reference
In-Depth Information
Next in the list is the bookSeat method, which, as you might have guessed, will be used
to book a seat. Finally, the doCleanUp method is actually used to perform a cleanup if
you want to restart the application.
The last piece of our puzzle is the BookerService class, which adds a tiny session lay-
er to your application:
public class BookerService implements Serializable {
private static final long serialVersionUID =
private Logger logger;
private TicketService ticketService;
private FacesContext facesContext;
private int money;
public void createCustomer() { = 100;
public void bookSeat(long seatId, int price) {"Booking seat " + seatId);
if (price > money) {
final FacesMessage m = new
FacesMessage(FacesMessage.SEVERITY_ERROR, "Not enough
"Registration successful");
facesContext.addMessage(null, m);
Search WWH ::

Custom Search