Wednesday, June 3, 2015

ServletContext

Introduction

ServletContext Interface is used for sharing the information between all servlets in web application.
Through this interface, a Servlet can access raw input streams to Web Application resources, dispatch requests, a common mechanism for logging information, and an application scope for binding objects.

Description

A Servlet Context is used to maintain information for all instances of a Web application within any single JVM (that is, for all servlet and JSP page instances that are part of the Web application). There is one servlet context for each Web application running within a given JVM; this is always a one-to-one correspondence. You can think of a servlet context as a container for a specific application.
Servlet Context object provides information about the servlet environment such as name of the server) and allows sharing of resources between servlets in the group, within any single JVM. (For servlet containers supporting multiple simultaneous JVMs, implementation of resource-sharing varies.)

No comments: