Dear All,
I implmeneted a stateful session bean to represent a shopping cart and invoking this bean from
servlet. Every time I add an item to the cart I am showing the number of items in the Servlet. However, the bean is returning the recently added items always and not preserving previously added items in the list. The following is the code I am using.
Stateful Session Bean Code:
Servlet Code:
Item Code:
My understanding is, the bean's @PostConstruct call back is being called every time I add an item to the cart. I do not know why a new instance is being returned for each servlet call eventhough I am using the same bean reference to add item to cart and to get items from cart. Please help!
I deployed this bean to Glassfish V3 along with web application as an EAR using Eclipse.
Sai Surya, SCJP 5.0, SCWCD 5.0, IBM 833 834
http://sai-surya-talk.blogspot.com, I believe in Murphy's law.