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 must be implemented by all servlets?
What are session variable in servlets?
What exception should be thrown when servlet is not properly initialized?
How will two or three servlets interact or communicate with each other?
Name the packages that work with servlet?
What are the drawbacks of cgi?
What is the use of attribute in servlets?
What are different ways for authentication of servlet?
Can we refresh servlet in client and server side automatically?
What if you need to span your transaction across multiple servlet invocations?
Hi frnd can i any one kindly can post for me portlet,hibernate and spring example application and with flow explantion configuration using Jdeveloper.and related links ar tutorials kindly please send me .its urgent for me .thanks in advance...........else can any one send to kondaiah.goddeti@gmail.com
What is a servlet engine?
What is http servlet in java?
What is servlet and its advantages?
What is a generic servlet?