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
Explain in brief the directory structure of a web application?
What do you mean by url pattern in servlet?
What is a servlet context?
How native code can be used in a servlet?
Tell us something about servletconfig interface.
What are different methods of session management in servlets?
What is meant by servlet? What are the parameters of the service method?
How do you communicate in between Applets and Servlets?
What do you mean by singlethreadmodel interface?
How httpservlet is different from the genericservlet?
What is generic servlet class?
How to make sure a servlet is loaded at the application startup?
What are the benefits of using servlet over cgi?
How servlet is created?
What is life cycle of Servlet?