org.mortbay.jetty.handler
public class ErrorHandler extends AbstractHandler
_string
Constructor and Description |
---|
ErrorHandler() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCacheControl()
Get the cacheControl.
|
void |
handle(java.lang.String target,
HttpServletRequest request,
HttpServletResponse response,
int dispatch)
Handle a request.
|
protected void |
handleErrorPage(HttpServletRequest request,
java.io.Writer writer,
int code,
java.lang.String message) |
boolean |
isShowStacks() |
void |
setCacheControl(java.lang.String cacheControl)
Set the cacheControl.
|
void |
setShowStacks(boolean showStacks) |
protected void |
write(java.io.Writer writer,
java.lang.String string) |
protected void |
writeErrorPage(HttpServletRequest request,
java.io.Writer writer,
int code,
java.lang.String message,
boolean showStacks) |
protected void |
writeErrorPageBody(HttpServletRequest request,
java.io.Writer writer,
int code,
java.lang.String message,
boolean showStacks) |
protected void |
writeErrorPageHead(HttpServletRequest request,
java.io.Writer writer,
int code,
java.lang.String message) |
protected void |
writeErrorPageMessage(HttpServletRequest request,
java.io.Writer writer,
int code,
java.lang.String message,
java.lang.String uri) |
protected void |
writeErrorPageStacks(HttpServletRequest request,
java.io.Writer writer) |
destroy, doStart, doStop, getServer, setServer, toString
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
public void handle(java.lang.String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws java.io.IOException
Handler
target
- The target of the request - either a URI or a name.request
- 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
- 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
- The dispatch mode: Handler.REQUEST
, Handler.FORWARD
, Handler.INCLUDE
, Handler.ERROR
java.io.IOException
protected void handleErrorPage(HttpServletRequest request, java.io.Writer writer, int code, java.lang.String message) throws java.io.IOException
java.io.IOException
protected void writeErrorPage(HttpServletRequest request, java.io.Writer writer, int code, java.lang.String message, boolean showStacks) throws java.io.IOException
java.io.IOException
protected void writeErrorPageHead(HttpServletRequest request, java.io.Writer writer, int code, java.lang.String message) throws java.io.IOException
java.io.IOException
protected void writeErrorPageBody(HttpServletRequest request, java.io.Writer writer, int code, java.lang.String message, boolean showStacks) throws java.io.IOException
java.io.IOException
protected void writeErrorPageMessage(HttpServletRequest request, java.io.Writer writer, int code, java.lang.String message, java.lang.String uri) throws java.io.IOException
java.io.IOException
protected void writeErrorPageStacks(HttpServletRequest request, java.io.Writer writer) throws java.io.IOException
java.io.IOException
public java.lang.String getCacheControl()
public void setCacheControl(java.lang.String cacheControl)
cacheControl
- the cacheControl header to set on error responses.public boolean isShowStacks()
public void setShowStacks(boolean showStacks)
showStacks
- True if stack traces are shown in the error pagesprotected void write(java.io.Writer writer, java.lang.String string) throws java.io.IOException
java.io.IOException
Copyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.