what is difference between servletconfig and servletcontext?
Answer Posted / p.nandakishore
ServletConfig and ServletContext are interfaces in
javax.servlet package
ServletConfig is one per one Servlet.Each servlet as its
own ServletConfig object.The ServletConfig object is
provided by the Container during the initialization phase
of the Servlet.ServletConfig object can be user to read
initialization parameters into the Servlet from web.xml.
ServletContext is one per one web-application.All servlets
which are in a web-application have common ServletContext.
ServletContext can be used to communicate the Servlet with
the ServletContainer.It can also be used to read
initialization parameters from web.xml.It can be used to
share some resources between servlets which are in a web-
application.(resources like Connection object)
| Is This Answer Correct ? | 16 Yes | 0 No |
Post New Answer View All Answers
What is the point of java?
What is a wrapper method?
What is Garbage Collection in Java
How do you sort in descending order in java using collections sort?
What is outofmemoryerror in java?
How do you convert boolean to boolean?
Can we instantiate interface in java?
What is thread pool in java with example?
Which list is sorted in java?
Explain about java sdk?
Explain the use of shift operator in java. Can you give some examples?
What happens when you invoke a thread’s interrupt method while it is sleeping or waiting?
Write a program to print the pattern given below
Is double bigger than float?
What is a platform?