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 can we refresh automatically when new data has entered the database?
What is the process to implement doget and dopost methods?
What are the differences between servlet context vs servlet config?
What is servlet and its types?
how many jsp scripting elements are there and what are those?
What is load-on-startup in servlet?
What are the phases of a servlet life cycle?
How can we upload the file to the server using servlet?
What are the difference between RMI and Servlets?
What is a servlet engine?
What are the steps involved in placing a servlet within a package?
What are the supporting protocol by HttpServlet ?
What is servlet in web technology?
What is url encoding and url decoding
How printwriter is different from servletoutputstream?