ServletContext is an interface that is defined in the javax.servlet package. It describes a set of methods for communicating with the servlet container. For example, dispatch requests, to get the MIME type of a file, or write to a log file.
application has only one ServletContext, which is accessible to all the active
resources of that application. The ServletContext can also be used by the
servlets to share the data with one to another.
A Servlet can access raw input streams to Web Application resources, virtual directory translation, a common mechanism for logging information, and an application scope for binding objects through the ServletContext interface. It 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.
Read more at:
Posted on: November 17, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles