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
Which method returns the length of a string?
Which is better 64 bit or 32 bit?
What is an object in java and how is it created?
What is main function purpose?
what is a working thread? : Java thread
When we should use serialization?
Do extraneous variables affect validity?
Explain the use of javap tool.
Is char * a string?
what is daemon thread and which method is used to create the daemon thread? : Java thread
what do you mean by marker interface in java?
Why constructor has no return type?
What is a function in java?
Where is singleton pattern used?
What is a “stateless” protocol ?