File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Having problems in sessions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Having problems in sessions" Watch "Having problems in sessions" New topic

Having problems in sessions

Anil Verghese
Ranch Hand

Joined: Oct 11, 2006
Posts: 155

I am doing a shopping cart application... I have given an option to browse through the whole records and also an option to select. I placed all the selected items in a vector in the Action class.. then set it as a session. The control goes to a jsp page where the selected items are displayed.

the problem starts here if i select back it goes back to the browse page and if i reselect anything else and click next instead of displaying the new values the old ones are displayed.....

Need help!!!
Kaustabh Singha Roy
Ranch Hand

Joined: Oct 04, 2005
Posts: 43
As I cant see the actual code I can only guess. As it appears the problem is in the way the list is handled in the session. Once you go back and edit the selected items the list need to be carefully edited in the session. I suggest that instead of keeping the list directly in the session keep a value object there, and make the list of items a member of it. You can then define flexible operation to the list as the methods of the class. It would also enable you to keep other informations too at a common class.
I agree. Here's the link:
subject: Having problems in sessions
It's not a secret anymore!