This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Getting MEAN with Mongo, Express, Angular, and Node and have Simon Holmes 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
 
 
subject: HttpSession