Top Description Fields Constructors Methods
org.mortbay.jetty.handler

public Class DefaultHandler

extends AbstractHandler
Class Inheritance
Imports
java.io.IOException, .OutputStream, java.net.URL, javax.servlet.ServletException, javax.servlet.http.HttpServletRequest, .HttpServletResponse, org.mortbay.jetty.Handler, .HttpConnection, .HttpHeaders, .HttpMethods, .MimeTypes, .Request, .Server, org.mortbay.log.Log, org.mortbay.util.ByteArrayISO8859Writer, .IO, .StringUtil

Default Handler. This handle will deal with unhandled requests in the server. For requests for favicon.ico, the Jetty icon is served. For reqests to '/' a 404 with a list of known contexts is served. For all other requests a normal 404 is served. TODO Implement OPTIONS and TRACE methods for the server.
Author
Greg Wilkins (gregw)

Field Summary

Modifier and TypeField and Description
pack-priv byte[]
pack-priv long
pack-priv boolean
Inherited from org.mortbay.jetty.handler.AbstractHandler:
_string

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

Returns true if the handle can server the jetty favicon.ico
getServeIcon
()

public void
handle(String
The target of the request - either a URI or a name.
target
,
HttpServletRequest
The request either as the Request object or a wrapper of that request. The HttpConnection#getCurrentConnection() method can be used access the Request object if required.
request
,
HttpServletResponse
The response as the Response object or a wrapper of that request. The HttpConnection#getCurrentConnection() method can be used access the Response object if required.
response
,
int
The dispatch mode: REQUEST, FORWARD, INCLUDE, ERROR
dispatch
)

Implements org.mortbay.jetty.Handler.handle.

Handle a request.
public void
setServeIcon(boolean
true if the handle can server the jetty favicon.ico
serveIcon
)

Inherited from org.mortbay.jetty.handler.AbstractHandler:
destroydoStartdoStopgetServersetServertoString

Field Detail

_faviconback to summary
pack-priv byte[] _favicon
_faviconModifiedback to summary
pack-priv long _faviconModified
_serveIconback to summary
pack-priv boolean _serveIcon

Constructor Detail

DefaultHandlerback to summary
public DefaultHandler()

Method Detail

getServeIconback to summary
public boolean getServeIcon()
Returns:boolean

Returns true if the handle can server the jetty favicon.ico

handleback to summary
public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException

Implements org.mortbay.jetty.Handler.handle.

Doc from org.mortbay.jetty.Handler.handle.

Handle a request.

Parameters
target:String

The target of the request - either a URI or a name.

request:HttpServletRequest

The request either as the Request object or a wrapper of that request. The HttpConnection#getCurrentConnection() method can be used access the Request object if required.

response:HttpServletResponse

The response as the Response object or a wrapper of that request. The HttpConnection#getCurrentConnection() method can be used access the Response object if required.

dispatch:int

The dispatch mode: REQUEST, FORWARD, INCLUDE, ERROR

setServeIconback to summary
public void setServeIcon(boolean serveIcon)
Parameters
serveIcon:boolean

true if the handle can server the jetty favicon.ico