Moazzam wrote:I'm assuming you mean it's not initialized with new anywhere. If the cart variable were not defined anywhere, you'd get a compile time error.
In BookstoreBean.java, the cart object is not defined anywhere.
Is it due to context and dependency injection?See where the cart variable is defined.
You can't learn JSF by staring at example code
@Inject ShoppingCart cart;