wood burning stoves 2.0*
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: HttpSession
 
Similar Threads
Session info getting lost between servlets.
Pass session from JSP to servlet?
session.isNew() is always returning false
maintaining session
Sessions with database