Is there any differance b/w getting servlet context from
servlet config and session? if yes then what is that?
Answer Posted / rajendra singh bisht
You can get reference to ServletContext through ServletConfig. HttpSession does not provide a reference to ServletContext object.
To get a ServletContext object use
getServletConfig().getServletContext();
or you can call directly getServletContext() bcoz GenericServlet class implements ServletConfig interface also.
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What are important features of Servlet 3?
Elucidate servlet attributes and its scope?
How to commuincate between an applet and a servlet?
How to handle exceptions thrown by application with another servlet?
Explain jsessionid and when is it created?
What are the kinds of http requests?
How do you create a cookie using servlet?
Write a simple servlet program to print the contents of html.
Why do you use session tracking in httpservlet?
What are the benefits of using servlet over cgi?
How do we share data using 'getservletcontext ()?
What is the difference in between the httpservlet and generic servlet?
How can an existing session be invalidated?
Is servlet a framework?
Is servlet thread safe?