public class ErrorPageErrorHandler extends ErrorHandler
Modifier and Type | Field and Description |
---|---|
protected java.util.List |
_errorPageList |
protected java.util.Map |
_errorPages |
protected ServletContext |
_servletContext |
_string
Constructor and Description |
---|
ErrorPageErrorHandler() |
Modifier and Type | Method and Description |
---|---|
void |
addErrorPage(java.lang.Class exception,
java.lang.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,
java.lang.String uri)
Add Error Page mapping for a status code range.
|
void |
addErrorPage(int code,
java.lang.String uri)
Add Error Page mapping for a status code.
|
protected void |
doStart() |
protected void |
doStop() |
java.util.Map |
getErrorPages() |
void |
handle(java.lang.String target,
HttpServletRequest request,
HttpServletResponse response,
int dispatch)
Handle a request.
|
void |
setErrorPages(java.util.Map errorPages) |
getCacheControl, handleErrorPage, isShowStacks, setCacheControl, setShowStacks, write, writeErrorPage, writeErrorPageBody, writeErrorPageHead, writeErrorPageMessage, writeErrorPageStacks
destroy, getServer, setServer, toString
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
protected ServletContext _servletContext
protected java.util.Map _errorPages
protected java.util.List _errorPageList
public void handle(java.lang.String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws java.io.IOException
Handler
handle
in interface Handler
handle
in class ErrorHandler
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
public java.util.Map getErrorPages()
public void setErrorPages(java.util.Map errorPages)
errorPages
- The errorPages to set. A map of Exception class name or error code as a string to URI stringpublic void addErrorPage(java.lang.Class exception, java.lang.String uri)
code
- The class (or superclass) of the matching exceptionsuri
- The URI of the error page.public void addErrorPage(int code, java.lang.String uri)
code
- The HTTP status code to matchuri
- The URI of the error page.public void addErrorPage(int from, int to, java.lang.String uri)
from
- The lowest matching status codeto
- The highest matching status codeuri
- The URI of the error page.protected void doStart() throws java.lang.Exception
doStart
in class AbstractHandler
java.lang.Exception
protected void doStop() throws java.lang.Exception
doStop
in class AbstractHandler
java.lang.Exception
Copyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.