Java Reference
In-Depth Information
Creating the beans
Once your project is properly configured, we can start modeling our beans. The first bean
we will upgrade is TheatreBooker , which will drive the user session, accessing the
ticket list from our TheatreBox bean:
package com.packtpub.wflydevelopment.chapter4.controller;
import
com.packtpub.wflydevelopment.chapter4.boundary.TheatreBox;
import org.jboss.logging.Logger;
import javax.annotation.PostConstruct;
import javax.enterprise.context.SessionScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named;
import java.io.Serializable;
@Named [1]
@SessionScoped [2]
public class TheatreBooker implements Serializable {
@Inject
private Logger logger; [3]
@Inject
private TheatreBox theatreBox; [4]
@Inject
private FacesContext facesContext; [5]
private int money;
@PostConstruct
public void createCustomer() {
this.money = 100;
Search WWH ::




Custom Search