This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes HttpSession Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "HttpSession" Watch "HttpSession" New topic
Author

HttpSession

Bala Krishniah
Ranch Hand

Joined: Dec 14, 2000
Posts: 81
I am creating the session in one servlet and storing the required data into it.
Is it possible to get the sesion, append the data into the session and store in back into the session in the same method repeatedly (ie 3 times) ie everytime the servlet called.
for ex:
class MyServlet
{
if( first time this servlet called)
{
session = request.getSession(true);
session.putValue(...);
}
if( second time this servlet called)
{
session = request.getSession(true);
session.putValue(...);
}
if( second time this servlet called)
{
session = request.getSession(true);
session.putValue(...);
}
}
Thanks
sameera k
Greenhorn

Joined: Oct 27, 2000
Posts: 5
yes it is possible to do so
every time the servlet is called u just keep the value name same and u can change the value
it just overwrites the previous value
thanks
sameera


sameera kocharekar
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: HttpSession
 
It's not a secret anymore!