I would like to implement a shopping cart with Spring, so I need to save an object Cart ( which has attributes like products, paymentType and deliveryType ) in session. I’ve tried to create it with bean and attribute “scope” set to “session”, but it just doesn’t work, should I use some additional annotations in my controller or Cart class? Any example usage would be really helpful 🙂 Thanks in advance.
I would like to implement a shopping cart with Spring, so I need to
Share
and then
should work, if it is declared in the web context (dispatcher-servlet.xml). An alternative option is to use the raw session and put your cart object there: