Shared cart problem EJB/Struts application
I'm making an e-commerce website.
I use EJB for business part, and Struts2 for presentation part.
A Stateless management bean contains a Stateful Cart bean. (I use injection with @EJB)
I use struts2ejb3 - EJB3 support for Struts 2 - Google Project Hosting plugin to inject EJB in my Struts Actions.
I noticed that all my clients share the same cart, normally each client should have its own cart.
Then I modified the management bean to Stateful.
I use 2 fat shell clients, with both EJB as Stateful, each Cart is seperated, that's ok.
But on the web client, the Cart is always empty. As it works with a shared cart, I don't think it's a problem linked to my use of Struts/JSP.
Even if I save the EJB in the session, the Cart is always empty with both Stateful EJB.
Do you have an idea of what's wrong ?
Re: Shared cart problem EJB/Struts application
In fact, on each page loading, I was overwriting my session variable with a new Stateful, and on each lookup the server sends me a new Stateful instead of the one linked to the client.
Then, I correctly set my session variable with the Stateful, without overwriting it at each page loading, and it works.