ServletContext is a interface which helps us to communicate with the servlet container.
There is only one ServletContext for the entire web application and the components of the web application can share it.
The information in the ServletContext will be common to all the components. Remember that each servlet will have its own ServletConfig.
The ServetContext is created by the container when the web application is deployed and after that only the context is available
to each servlet in the web application.
ServletContext defines a set of methods that a servlet uses to communicate with its servlet container.
ServletConfig is a servlet configuration object used by a servlet container used to pass information to a servlet during initialization.
All of its initialization parameters can ONLY be set in deployment descriptor.
The ServletContext object is contained within the ServletConfig object, which the Web server provides the servlet
when the servlet is initialized.
You can specify param-value pairs for ServletContext object in <context-param> tags in web.xml file.
The ServletConfig parameters are specified for a particular servlet and are unknown to other servlets.
The ServletContext parameters are specified for an entire application outside of any particular servlet and
are available to all the servlets within that application
ServletContext is represents your web application,so there is only one sevletContext for your application.
For particular servlet in your application there is one ServletConfig so,if 10 servlets are there in your
application then there are 10 ServletConfigs.
For more information on ServletContext and ServletConfig visit to :http://www.roseindia.net/servlets/ServletContext.shtmlhttp://www.roseindia.net/tutorialsearch/?t=role%20of%20servletconfighttp://www.roseindia.net/tutorialsearch/?t=what%20is%20the%20difference%20between%20SerletContext%20and%20ServletConfighttp://www.roseindia.net/servlets/use-log-servlet-context.shtml