struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Srineel Mazumdar <smaz19...@gmail.com>
Subject Re: Value not persisting in domain object
Date Tue, 03 Sep 2013 00:15:30 GMT
Hi Umesh and Paul,

I have attached the code. Cart.java is my domain class where itemlist will
have all the items added in the cart. AddItemToCartAction will add to
itemList and UpdateCartQuantitiesAction will fetch it from itemList. I
agree to what Paul ..but can you suggest a workaround??

This is actually the JPetstore project I am working on. I am rewritting the
code in Struts 2 . I select FISH,Add to Cart and then Update Cart. In
Update Cart, it shows Cart is Empty.

Please help with a solution.


On Sun, Sep 1, 2013 at 10:14 PM, Paul Benedict <pbenedict@apache.org> wrote:

> Every Action class is instantiated per request. If you're updating a
> collection in one action, it will, of course, not be around in the next
> collection. It sounds like you need to stuff your shopping cart into the
> session.
>
>
> On Sun, Sep 1, 2013 at 8:39 PM, Srineel Mazumdar <smaz19584@gmail.com
> >wrote:
>
> > Hi All,
> >
> > Can anyone please help ?
> >
> > Thanks..
> >
> >
> > On Fri, Aug 30, 2013 at 10:23 PM, Srineel Mazumdar <smaz19584@gmail.com
> > >wrote:
> >
> > > Yes.. the same collection.
> > >
> > >
> > > On Wed, Aug 28, 2013 at 6:55 PM, Paul Benedict <pbenedict@apache.org
> > >wrote:
> > >
> > >> Are you retrieving the same collection?
> > >>
> > >>
> > >> On Wed, Aug 28, 2013 at 8:22 AM, Srineel Mazumdar <
> smaz19584@gmail.com
> > >> >wrote:
> > >>
> > >> > Hi,
> > >> >
> > >> > I am creating a shopping cart application in Struts 2. I am
> updating a
> > >> list
> > >> > in Cart domain object when the user selects some items in shopping
> > list
> > >> > using checkboxes and clicks Next. In the CheckOut page those items
> > >> would be
> > >> > shown. But in my case it shows empty list. Upon debugging, I find
> that
> > >> list
> > >> > is updated finally, but an empty list is fetched in Check Out page.
> > >> >
> > >> > Can somebody help me by giving some pointers ?
> > >> >
> > >> > Thanks.,
> > >> > Srineel
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Cheers,
> > >> Paul
> > >>
> > >
> > >
> >
>
>
>
> --
> Cheers,
> Paul
>

Mime
View raw message