- HandlerCollection - A collection of handlers, where each handler is called regardless of the state of the request. This is typically used to pass a request to a ContextHandlerCollection and then the a RequestLogHandler
- HandlerList - A list of handlers which are called in turn until the request state is set as handled.
- ContextHandlerCollection - collection of Handlers of which on is selected by best match for the context path.
Handlers are usually arranged in a list and a request presented to each handler in turn until (or at most) one indicates that the request has been handled. In this situation, this will allow handlers to:
- Ignore requests that are not applicable
- Handle requests by populating the response and/or generating content
- Modify the request but allow it to pass onto the next handler(s). Headers and attributes may be modified or an InputStream filter added
- Modify the response but allow the request to pass onto the next handler(s). Headers may be modified or OutputStream filters added
There are some examples of implementing custom handlers in the Embedded Examples.
See also Newbie Guide to Jetty.
handler package for some examples.