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 is servlet lazy loading?
What is difference between jsp and servlet?
Which application server is best for java?
What are the mechanisms used by a servlet container for maintaining session information?
List the Different types of servlet?
How is an application exception handling is done using a servlet?
Is dispatcher servlet a singleton?
What are the phases of servlet life cycle?
What is Servlet API used for connecting database?
What is a deployment descriptor?
What is servlet instance?
Is servlet synchronized?
How can we create deadlock situation in servlet?
How do we call one servlet from another servlet?
What is a server side include (ssi)