what is the difference between ServletContext and
ServletConfig
Answers were Sorted based on User's Feedback
Answer / dhil
Saurabh Kandpal..
servletcontext is for the whole webapplication and
servletconfig for a individual servlet
| Is This Answer Correct ? | 13 Yes | 1 No |
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 |
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 |
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 |
Answer / ravikiran.chd
Servletcontext is one per webapplication and servlet config
is one per servlet
| Is This Answer Correct ? | 1 Yes | 0 No |
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 |
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 |
What are the benefits of using servlet over cgi?
What is Generic Servlet and how it is different from Http Servlet?
If we disable cookies in our web page, what will happen?
How can I share objects across different sessions?
explain the advantages of servlet life cycle?
What are the steps that are required to handle the multi-threading?
how do you maintain sessions in servlets?
Write a servlet to upload file on server.
What is the capacity that doGet method can send to the server?
What do you mean by request dispatcher in servlet? Also explain its methods.
What do you mean by filter in servlet?
Tell us something about servletcontext interface.