How can I get one Servlet's Context Information in another Servlet?
Printable View
How can I get one Servlet's Context Information in another Servlet?
We can Servlet context information using the ServletContext object . i am writing the code pls go through this.
First SERVLET:
ServletContext sc=getServletContext();
sc.setAttribuer("name","value");//the value may also be an object
Second Servlet:
ServletContext sc=getServletContext();
sc.getAttribute(name); //this will returns the value.
I think this is fine and any problem send message .