Saturday, May 2, 2015

Servlet Context Interface


javax.servlet.ServletContext interface provides access to web application variables to the
servlet. The ServletContext is unique object and available to all the servlets in the web
application. When we want some init parameters to be available to multiple or all of the
servlets in the web application, we can use ServletContext object and define parameters
in web.xml using <context-param> element. We can get the ServletContext object via the
getServletContext() method of ServletConfig. Servlet engines may also provide context objects
that are unique to a group of servlets and which is tied to a specific portion of the URL path
namespace of the host.

No comments:

Post a Comment

Contact Form

Name

Email *

Message *