Previous Topic

Next Topic

Book Contents

Book Index

HTTP Context

The methods for registration of both resources and servlets require HttpContext objects. They contain data used by the HTTP Service during resource registration. In an HttpContext, a developer specifies the MIME type of the response sent to the HTTP client, maps a resource to an URL and manages security on received client requests. If a client request requires authentication, then security can be established with the HTTP Access Authentication schemes.

The HTTP Service provides a default implementation of HttpContext that can be loaded by passing null for the HttpContext instance when registering a resource or a servlet, or can be instantiated through the createDefaultHttpContext method of the HTTP Service. This default HttpContext handles authentication security using the Basic Access Authentication Scheme.