what is the difference between ServletContext and
ServletConfig

Answers were Sorted based on User's Feedback



what is the difference between ServletContext and ServletConfig..

Answer / dhil

Saurabh Kandpal..

servletcontext is for the whole webapplication and
servletconfig for a individual servlet

Is This Answer Correct ?    13 Yes 1 No

what is the difference between ServletContext and ServletConfig..

Answer / sreenu bassha

ServletContext:ServletContext interface contains basic
methods to find the path information, accessing other
servlets,etc.
ServletConfig:ServletConfig interface contains basic
methods to get the initialization parameters and
servletContext object.

Is This Answer Correct ?    6 Yes 1 No

what is the difference between ServletContext and ServletConfig..

Answer / balu

yes ur correct Saurabh..

servletcontext scope is of total application..where as
servletconfig is only for the servlet....

servletcontext gets created when the server starts i.e when
the server reads the web.xml of the application which is
being deployed in the server...
where as servletconfig get created when the servletobject
gets created...

Is This Answer Correct ?    6 Yes 1 No

what is the difference between ServletContext and ServletConfig..

Answer / saikiran

the scope of ServletConfig is With in the servlet
ServletContext is with in webApplication.
ServletConfig is an name and value pairs
it consist of
servletName,InitializationParameters,servletContext
ServletContext:
---------------
the application which is being deployed in the
server...

Is This Answer Correct ?    1 Yes 0 No

what is the difference between ServletContext and ServletConfig..

Answer / ravikiran.chd

Servletcontext is one per webapplication and servlet config
is one per servlet

Is This Answer Correct ?    1 Yes 0 No

what is the difference between ServletContext and ServletConfig..

Answer / ibm_smart

Hello,
Actually Balu what Dhil wrote was right.
Saurabh Kandpal whote the reverse which is not true.

Is This Answer Correct ?    0 Yes 0 No

what is the difference between ServletContext and ServletConfig..

Answer / saurabh kandpal

servletcontext is for a individual servlet

servlet config is for the whole webapplication which may
include diffrent servlet context

Is This Answer Correct ?    3 Yes 37 No

Post New Answer

More Servlets Interview Questions

Which interface must be implemented by all servlets?

0 Answers  


What if you need to span your transaction across multiple servlet invocations?

0 Answers  


What methodology can be followed to store more number of objects in a remote server?

0 Answers  


What is use of parseQueryString ?

1 Answers  


How can we refresh automatically when new data is entered into the database?

0 Answers  






Difference between web container & web server........... Difference between web server & application server?????????

8 Answers   TCS,


Differentiate between the print writer and servlet output stream?

0 Answers  


Who is responsible for writing a constructor?

0 Answers  


what are the CGI Programs?

5 Answers  


What is servlet context ?

4 Answers  


How session tracking can be achieved, if your browser doesn't support cookies (or) if cookies are disabled?

2 Answers  


why are using HttpServlet in realtime projects and why are not using Genericservlet

2 Answers  


Categories