Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: JSP Servlet
Can some one please explain it with an example
Posted 4-Jun-13 21:57pm
Shubhashish_Mandal at 5-Jun-13 3:33am
Session use key-value pair to store data. You can store object in session and can retrieve it and can modify it against the key. But keep in mind , try to avoid to use session to store huge data.
Shruthi GM at 5-Jun-13 5:54am
Thanks Shubhashish. Can u please give me an example for this. I just want to store user information like(name, age, Dob, etc)in session and display it on jsp and again update the informations in same session
Shubhashish_Mandal at 5-Jun-13 7:12am
its very easy and I believe you can do this. Instead of putting all the information(name, age dob) separately in session, create an instance of type "User"(with name, age, dob properties) and set it in the session with a key.
To modify it simply retrieve it from session , then modify it and again set it in the session with the same key.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 445
1 Sergey Alexandrovich Kryukov 322
2 Maciej Los 275
3 CHill60 195
4 King Fisher 179
0 OriginalGriff 240
1 Maciej Los 95
2 Sascha Lefévre 85
3 King Fisher 70
4 F-ES Sitecore 55

Advertise | Privacy | Mobile
Web04 | 2.8.150331.1 | Last Updated 5 Jun 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100