Is there any differance b/w getting servlet context from
servlet config and session? if yes then what is that?
Answer Posted / sandhya
YES,There is some difference,when we deploy the web
application the web container will create the Context
object and when we load the servlet class then container
will create config object,so for each web application web
container will create one servlet context obj and for each
servlet web container will create servlet config object.
Generally we use this objects to avoid the hardcoding,we
declare this variables in deployment descriptor,we declare
context parameters under web-app tag so that all servlets
can use this parameter values ,and config parameters under
servlet tag so that only specific servlet can use this
parameter values,in simple way context object is like
global object and config obj is like local obj.
Is This Answer Correct ? | 8 Yes | 3 No |
Post New Answer View All Answers
What are the ways to handle multi-threading in servlets?
What is cgi?
If servlet receives multiple requests, how many objects will it create?
Which interface should be implemented by all servlets?
Explain in brief the directory structure of a web application?
What are the uses of servlet
Differentiate between the print writer and servlet output stream?
What is the difference between Servlet Request and Servlet Context when calling a Request Dispatcher?
What's the servlet interface?
What is servlet name in web xml?
Explain the architechure of a servlet?
Can filter be used as request or response?
What’s the difference between genericservlet and httpservlet?
Write a program to show the functionality of doget and dopost method?
What is session?