当我的 Web 应用程序从我的ProductsBean
.
我收到此错误:Can't instantiate class: beans.ProductsBean
这是我的ProductsBean
:
@ManagedBean
@ViewScoped
public class ProductsBean implements Serializable {
private List<ProductBean> products;
@ManagedProperty(value = "#{applicationBean}")
private ApplicationBean applicationBean;
private ProductBean selectedProduct;
public ProductsBean() {
Store store = applicationBean.getStore();
for (String c : store.getCategories()) {
for (Product p : store.getProductsOfCategory(c)) {
products.add(new ProductBean(p.getProduct_id(), p.getDescription(), p.getPrice(), p.getCategoryName()));
}
}
这个错误的原因是什么?