top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is a Servlet Context?

+1 vote
338 views
What is a Servlet Context?
posted Dec 18, 2015 by Roshni

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

A Servlet Context is a grouping under which related servlets (and JSPs and other web resources) run. They can share data, URL namespace, and other resources. There can be multiple contexts in a single servlet container.

The ServletContext object is used by an individual servlet to “call back” and obtain services from the container (such as a request dispatcher). Read the JavaDoc for javax.servlet.ServletContext for more information.

Interface ServletContext. Defines a set of methods that a servlet uses to communicate with its servlet container, for example, to get the MIME type of a file, dispatch requests, or write to a log file. There is one context per "web application" per Java Virtual Machine.

answer Dec 21, 2015 by Karthick.c
...