Click here to Skip to main content
15,887,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I have three servlets one being called from within another.Im creating a http session in first servlet and setting some attributes for it. I want to getthose attributes in second and thirdservlets. How can i do that? Please suggest a way and give appropriate syntax.

Thanks in advance.
Posted
Comments
naveen712 5-May-12 12:50pm    
Please anyone help me out...

1 solution

C#
If two servlets are in the same webapp, they share the same session context, and the session is the same for both servlets. Of course, remember that a session is tight to a particular user.

Object value = request.getSession().getAttribute("nameOfTheAttributeUsedInTheFirstServlet");
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900