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 the two important api's in for servlets?
What are the different mode that servlets can be used?
Which interface should be implemented by all servlets?
Why servlet is used as controller ? Not JSP? I want complete explation?
Is servlet synchronized?
Is servlet thread safe?
Why do we have servlet wrapper classes?
How to rectify errors in java servlet while compilation?
What is servlet in simple terms?
Explain Action Servlet?
Define servlet mapping?
What is httpservlet class?
What is a web application and what is it’s directory structure?
What is the difference between jsp and servlet life cycle?
List some life cycle methods of a servlet.