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 predefined function in java?
What do you understand by java?
What is the difference between I ++ and ++ I in java?
What is a website container?
What do you mean by collectors in java 8?
What is the largest data type in java?
In how many ways we can do exception handling in java?
Does isempty check for null?
How do you ensure that n threads can access n resources without deadlock?
State some situations where exceptions may arise in java?
Java openings 3 - 5 years, Lnt Infotech. requirements - core java, J2ee, struts, hibernate Interview Date:- 19 March 2011 Time:- 9:00 AM to 12:00 Pm Interview Location - L & T Infotech, Manapakkam, Chennai Refererral PS NO:- 291649 (Please mention this when u fill the form only then u will be considered for interview) Documents Required:- Latest Resume, Photograph and last 3 payslips Mail me on vasan2211@gmail.com once u appear for interview
I want to persist data of objects for later use. What is the best approach to do so?
What is a Null object?
Write a program to find the greatest of three numbers in java?
What is the effect of keeping a constructor private?