Chapter SRV.4. Servlet Context


The ServletContext defines a servlet's view of the web application within which the servlet is running. The ServletContext also allows a servlet to access resources available to it. Using such an object, a servlet can log events, obtain URL references to resources, and set and store attributes that other servlets in the context can use. The container provider is responsible for providing an implementation of the ServletContext interface in the servlet container.

A ServletContext is rooted at a specific path within a web server. For example, a context could be located at http://www.mycorp.com/catalog . All requests that start with the /catalog request path, which is known as the context path , will be routed to this servlet context.

Only one instance of a ServletContext may be available to the servlets in a web application. In cases where the web application indicates that it is distributable, there must be only one instance of the ServletContext object in use per application per Java virtual machine.



Java 2 Platform, Enterprise Edition. Platform and Component Specifications
Java 2 Platform, Enterprise Edition: Platform and Component Specifications
ISBN: 0201704560
EAN: 2147483647
Year: 2000
Pages: 399

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net