org.mortbay.http
Interface HttpHandler

All Superinterfaces:
LifeCycle, java.io.Serializable
All Known Implementing Classes:
AbstractHttpHandler, DumpHandler, ErrorPageHandler, ExpiryHandler, ForwardHandler, HTAccessHandler, HttpContext, IPAccessHandler, MsieSslHandler, NotFoundHandler, NullHandler, PlusWebAppContext, ProxyHandler, ResourceHandler, RootNotFoundHandler, SecurityHandler, ServletHandler, ServletHttpContext, SetResponseHeadersHandler, WebApplicationContext, WebApplicationHandler

public interface HttpHandler
extends LifeCycle, java.io.Serializable

HTTP handler. The HTTP Handler interface is implemented by classes that wish to receive and handle requests from the HttpServer. The handle method is called for each request and the handler may ignore, modify or handle the request. Examples of HttpHandler instances include:

Version:
$Id: HttpHandler.java,v 1.11 2005/03/15 10:03:40 gregwilkins Exp $
Author:
Greg Wilkins (gregw)
See Also:
HttpServer, HttpContext

Method Summary
 HttpContext getHttpContext()
           
 java.lang.String getName()
          Get the name of the handler.
 void handle(java.lang.String pathInContext, java.lang.String pathParams, HttpRequest request, HttpResponse response)
          Handle a request.
 void initialize(HttpContext context)
           
 
Methods inherited from interface org.mortbay.util.LifeCycle
isStarted, start, stop
 

Method Detail

getName

java.lang.String getName()
Get the name of the handler.

Returns:
The name of the handler used for logging and reporting.

getHttpContext

HttpContext getHttpContext()

initialize

void initialize(HttpContext context)

handle

void handle(java.lang.String pathInContext,
            java.lang.String pathParams,
            HttpRequest request,
            HttpResponse response)
            throws HttpException,
                   java.io.IOException
Handle a request. Note that Handlers are tried in order until one has handled the request. i.e. until request.isHandled() returns true. In broad terms this means, either a response has been commited or request.setHandled(true) has been called.

Parameters:
pathInContext - The context path
pathParams - Path parameters such as encoded Session ID
request - The HttpRequest request
response - The HttpResponse response
Throws:
HttpException
java.io.IOException


Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.