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 session?
How can you run a servlet program?
What are the steps that are involved in using the httpservlet class?
Can servlet have a constructor ?
How can the session in servlet be destroyed?
What are its drawbacks of cgi?
Why is a constructor needed in a servlet even if we use the init method?
What are the two important api's in for servlets?
What do you mean by session tracking and also explain its techniques?
What are the types of servlets? Explain
Is it good idea to create servlet constructor?
What is the advantage of Servlets when compared with other server side technologies?
request parameter how to find whether a parameter exists in the request object?
How do cookies work in servlets?
Explain load on start-up and its importance?