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

public Class ErrorHandler

extends AbstractHandler
Class Inheritance
Known Direct Subclasses
org.mortbay.jetty.servlet.ErrorPageErrorHandler
Imports
java.io.IOException, .PrintWriter, .StringWriter, .Writer, javax.servlet.http.HttpServletRequest, .HttpServletResponse, org.mortbay.jetty.HttpConnection, .HttpGenerator, .HttpHeaders, .HttpMethods, .MimeTypes, org.mortbay.util.ByteArrayISO8859Writer, .StringUtil

Handler for Error pages A handler that is registered at the org.mortbay.http.ErrorHandler context attributed and called by the HttpResponse.sendError method to write a error page.
Author
Greg Wilkins (gregw)

Field Summary

Modifier and TypeField and Description
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 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.
protected void
handleErrorPage(HttpServletRequest request, Writer writer, int code, String message)

public boolean

Returns:

True if stack traces are shown in the error pages
isShowStacks
()

public void
setShowStacks(boolean
True if stack traces are shown in the error pages
showStacks
)

protected void
writeErrorPage(HttpServletRequest request, Writer writer, int code, String message, boolean showStacks)

protected void
writeErrorPageBody(HttpServletRequest request, Writer writer, int code, String message, boolean showStacks)

protected void
writeErrorPageHead(HttpServletRequest request, Writer writer, int code, String message)

protected void
writeErrorPageMessage(HttpServletRequest request, Writer writer, int code, String message, String uri)

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

Field Detail

_showStacksback to summary
pack-priv boolean _showStacks

Constructor Detail

ErrorHandlerback to summary
public ErrorHandler()

Method Detail

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

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

handleErrorPageback to summary
protected void handleErrorPage(HttpServletRequest request, Writer writer, int code, String message) throws IOException
isShowStacksback to summary
public boolean isShowStacks()
Returns:boolean

True if stack traces are shown in the error pages

setShowStacksback to summary
public void setShowStacks(boolean showStacks)
Parameters
showStacks:boolean

True if stack traces are shown in the error pages

writeErrorPageback to summary
protected void writeErrorPage(HttpServletRequest request, Writer writer, int code, String message, boolean showStacks) throws IOException
writeErrorPageBodyback to summary
protected void writeErrorPageBody(HttpServletRequest request, Writer writer, int code, String message, boolean showStacks) throws IOException
writeErrorPageHeadback to summary
protected void writeErrorPageHead(HttpServletRequest request, Writer writer, int code, String message) throws IOException
writeErrorPageMessageback to summary
protected void writeErrorPageMessage(HttpServletRequest request, Writer writer, int code, String message, String uri) throws IOException
writeErrorPageStacksback to summary
protected void writeErrorPageStacks(HttpServletRequest request, Writer writer) throws IOException