wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Having problems in sessions" Watch "Having problems in sessions" New topic
Author

Having problems in sessions

Anil Verghese
Ranch Hand

Joined: Oct 11, 2006
Posts: 155
hii,

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Having problems in sessions
 
Similar Threads
How to select a folder
How to get default value to my dropdown list
retaining selected values.....list box
MULTIPLE select - list box - how to read in servlet
Page Breaks...