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 are the legal operands of the instanceof operator?
How do you escape sequences in java?
Can we extend immutable class?
What are new features introduced with java 8 ?
What programs use java?
What is data type example?
Does .length start 0 java?
What is anti pattern in cyber security?
Differentiate between == and equals().
Can we clone singleton class in java?
What is callablestatement? How you can call stored procedure to pass in parameter?
How to set the permissions to a file in java?
Is int primitive data type?
What are the approaches that you will follow for making a program very efficient?
How can we make copy of a java object?