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 is httpservlet class?
Name the different ways of session tracking.
What are the benefits of using servlet over cgi?
What is a servlet context object?
What are the advantages of servlets over traditional cgi?
Why is it that we can't give relative URL's when using ServletContext.getRequestDispatcher() when we can use the same while calling ServletRequest.getRequestDispatcher()?
What is the use of httpservletrequestwrapper and httpservletresponsewrapper?
Differentiate between get and post?
Define servlet mapping?
Explain the features are in servlet 3?
Explain the difference between generic servlet and http servlet?
What’s the difference between forward() and sendredirect() methods?
hi actully i hav form columns with origin and destination names .as like as i need to create one more column with name amount. my requirement is when i select origin and destination columns automatically i need to get amount from database.how can i. please tel me with relative code
What do you mean by httpservlet and how it is different from the genericservlet?
Why the concept of single thread model interface is used?