1
我有一個applicationScoped bean,用於初始化我的Store。從javaBean獲取屬性
@ManagedBean(name="applicationBean", eager=true)
@ApplicationScoped
public class applicationBean implements Serializable {
private Store store;
public applicationBean() {
store = new Store();
}
public Store getStore() {
return store;
}
}
現在我想讓我的商店在我的另一個Bean中。
@ManagedBean(name="productsBean")
@RequestScoped
public class ProductsBean implements Serializable {
private List <Product> products;
public ProductsBean(){
}
}
如何從我的applicationScoped Bean中調用getter?