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
How do you invoke a servelt?
Which HTTP method is non-idempotent?
What is URL Encoding?
What do you mean by web applications? Explain web application directory arrangement?
What is the servlet?
Explain the difference between jsp and servlet?
Is dispatcher servlet a singleton?
Write a command to get actual path of a servlet to the server?
Can you use javascript in servlets?
What is servletconfig?
What is the major difference between servlet and applet?
What is meant by session? Tell me something about httpsession class?
Explain the different ways for servlet authentication?
Differentiate between the get and post method
What are the important functions of filters?