Results 1 to 2 of 2
- 04-19-2012, 10:22 PM #1
Member
- Join Date
- Apr 2012
- Posts
- 2
- Rep Power
- 0
Shared cart problem EJB/Struts application
Hi,
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 ?
Thanks.
- 05-01-2012, 08:04 PM #2
Member
- Join Date
- Apr 2012
- Posts
- 2
- Rep Power
- 0
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.
Similar Threads
-
Struts 2 : Problem : ClassNotFoundException: org.apache.struts.action.ActionServlet
By Divyanshu in forum Web FrameworksReplies: 1Last Post: 12-06-2011, 03:30 PM -
decorator.jsp problem building Struts Menu in JSP when Struts action is used
By dkirvan in forum JavaServer Pages (JSP) and JSTLReplies: 3Last Post: 04-29-2010, 05:33 AM -
URL Problem with IE7 in my struts Application
By SreenivasGurramkonda in forum Web FrameworksReplies: 0Last Post: 11-27-2008, 08:14 AM -
I need help for this shopping cart application!
By helloworld in forum New To JavaReplies: 3Last Post: 09-29-2008, 06:18 PM -
Shared variable mutual exclusion problem. Plz help
By elecrobot in forum Threads and SynchronizationReplies: 6Last Post: 11-25-2007, 02:43 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks