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


Please Help Members By Posting Answers For Below Questions

hi am an engineering student and my next plan is for ms in either in us or australia i got my passport but i dont know anything bout visa can u give brief idea 1)How to get prepared for visa and 2)How to apply for top universities and 3)How to pay the fee and so on These all are basic questions plz give me a clear idea

1460


Does sprintf add a null terminator?

562


What are loops in java?

550


What are the parts of a method?

537


What is a method in programming?

635






What about main thread in java?

648


Which variables are stored in stack?

449


How to convert string to char and vice versa?

515


What is oop principle in java?

546


What is threaded programming and when is it used? : Java thread

533


What is a package in java? List down various advantages of packages.

756


What are the wrapped, classes?

600


What is numel matlab?

657


What is a boolean in java?

579


What is the use of put method?

516