public class ErrorHandler extends AbstractHandler
_string| Constructor and Description |
|---|
ErrorHandler() |
| Modifier and Type | Method and Description |
|---|---|
String |
getCacheControl()
Get the cacheControl.
|
void |
handle(String target,
HttpServletRequest request,
HttpServletResponse response,
int dispatch)
Handle a request.
|
protected void |
handleErrorPage(HttpServletRequest request,
Writer writer,
int code,
String message) |
boolean |
isShowStacks() |
void |
setCacheControl(String cacheControl)
Set the cacheControl.
|
void |
setShowStacks(boolean showStacks) |
protected void |
write(Writer writer,
String string) |
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 |
writeErrorPageStacks(HttpServletRequest request,
Writer writer) |
destroy, doStart, doStop, getServer, setServer, toStringaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stoppublic void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException
Handlertarget - 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.ERRORIOExceptionprotected void handleErrorPage(HttpServletRequest request, Writer writer, int code, String message) throws IOException
IOExceptionprotected void writeErrorPage(HttpServletRequest request, Writer writer, int code, String message, boolean showStacks) throws IOException
IOExceptionprotected void writeErrorPageHead(HttpServletRequest request, Writer writer, int code, String message) throws IOException
IOExceptionprotected void writeErrorPageBody(HttpServletRequest request, Writer writer, int code, String message, boolean showStacks) throws IOException
IOExceptionprotected void writeErrorPageMessage(HttpServletRequest request, Writer writer, int code, String message, String uri) throws IOException
IOExceptionprotected void writeErrorPageStacks(HttpServletRequest request, Writer writer) throws IOException
IOExceptionpublic String getCacheControl()
public void setCacheControl(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(Writer writer, String string) throws IOException
IOExceptionCopyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.