public class ErrorPageErrorHandler extends ErrorHandler
| Modifier and Type | Field and Description |
|---|---|
protected List |
_errorPageList |
protected Map |
_errorPages |
protected ServletContext |
_servletContext |
_string| Constructor and Description |
|---|
ErrorPageErrorHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
addErrorPage(Class exception,
String uri)
Add Error Page mapping for an exception class
This method is called as a result of an exception-type element in a web.xml file
or may be called directly
|
void |
addErrorPage(int from,
int to,
String uri)
Add Error Page mapping for a status code range.
|
void |
addErrorPage(int code,
String uri)
Add Error Page mapping for a status code.
|
protected void |
doStart() |
protected void |
doStop() |
Map |
getErrorPages() |
void |
handle(String target,
HttpServletRequest request,
HttpServletResponse response,
int dispatch)
Handle a request.
|
void |
setErrorPages(Map errorPages) |
getCacheControl, handleErrorPage, isShowStacks, setCacheControl, setShowStacks, write, writeErrorPage, writeErrorPageBody, writeErrorPageHead, writeErrorPageMessage, writeErrorPageStacksdestroy, getServer, setServer, toStringaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopprotected ServletContext _servletContext
protected Map _errorPages
protected List _errorPageList
public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException
Handlerhandle in interface Handlerhandle in class ErrorHandlertarget - 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.ERRORIOExceptionpublic Map getErrorPages()
public void setErrorPages(Map errorPages)
errorPages - The errorPages to set. A map of Exception class name or error code as a string to URI stringpublic void addErrorPage(Class exception, String uri)
code - The class (or superclass) of the matching exceptionsuri - The URI of the error page.public void addErrorPage(int code,
String uri)
code - The HTTP status code to matchuri - The URI of the error page.public void addErrorPage(int from,
int to,
String uri)
from - The lowest matching status codeto - The highest matching status codeuri - The URI of the error page.protected void doStart()
throws Exception
doStart in class AbstractHandlerExceptionprotected void doStop()
throws Exception
doStop in class AbstractHandlerExceptionCopyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.