Results 1 to 2 of 2
  1. #1
    Danicela is offline Member
    Join Date
    Apr 2012
    Rep Power

    Default 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 ?


  2. #2
    Danicela is offline Member
    Join Date
    Apr 2012
    Rep Power

    Default 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

  1. Replies: 1
    Last Post: 12-06-2011, 04:30 PM
  2. decorator.jsp problem building Struts Menu in JSP when Struts action is used
    By dkirvan in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 04-29-2010, 06:33 AM
  3. URL Problem with IE7 in my struts Application
    By SreenivasGurramkonda in forum Web Frameworks
    Replies: 0
    Last Post: 11-27-2008, 09:14 AM
  4. I need help for this shopping cart application!
    By helloworld in forum New To Java
    Replies: 3
    Last Post: 09-29-2008, 07:18 PM
  5. Shared variable mutual exclusion problem. Plz help
    By elecrobot in forum Threads and Synchronization
    Replies: 6
    Last Post: 11-25-2007, 03:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts