Package org.eclipse.jetty.servlet
Class ErrorPageErrorHandler
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.server.handler.AbstractHandler
-
- org.eclipse.jetty.server.handler.ErrorHandler
-
- org.eclipse.jetty.servlet.ErrorPageErrorHandler
-
- All Implemented Interfaces:
Handler,ErrorHandler.ErrorPageMapper,Container,Destroyable,Dumpable,LifeCycle
public class ErrorPageErrorHandler extends ErrorHandler implements ErrorHandler.ErrorPageMapper
An ErrorHandler that maps exceptions and status codes to URIs for dispatch using the internal ERROR style of dispatch.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.ErrorHandler
ErrorHandler.ErrorPageMapper
-
Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler
AbstractHandler.ErrorDispatchHandler
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringGLOBAL_ERROR_PAGE-
Fields inherited from class org.eclipse.jetty.server.handler.ErrorHandler
ERROR_CONTEXT, ERROR_PAGE
-
-
Constructor Summary
Constructors Constructor Description ErrorPageErrorHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddErrorPage(int from, int to, java.lang.String uri)Adds ErrorPage mapping for a status code range.voidaddErrorPage(int code, java.lang.String uri)Adds ErrorPage mapping for a status code.voidaddErrorPage(java.lang.Class<? extends java.lang.Throwable> exception, java.lang.String uri)Adds ErrorPage mapping for an exception class.voidaddErrorPage(java.lang.String exceptionClassName, java.lang.String uri)Adds ErrorPage mapping for an exception class.java.lang.StringgetErrorPage(HttpServletRequest request)java.util.Map<java.lang.String,java.lang.String>getErrorPages()voidsetErrorPages(java.util.Map<java.lang.String,java.lang.String> errorPages)-
Methods inherited from class org.eclipse.jetty.server.handler.ErrorHandler
badMessageError, doError, errorPageForMethod, getCacheControl, getErrorHandler, getShowMessageInTitle, handle, isShowServlet, isShowStacks, setCacheControl, setShowMessageInTitle, setShowServlet, setShowStacks
-
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
destroy, getServer, setServer
-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, unmanage, updateBean, updateBean, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
-
-
-
Field Detail
-
GLOBAL_ERROR_PAGE
public static final java.lang.String GLOBAL_ERROR_PAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getErrorPage
public java.lang.String getErrorPage(HttpServletRequest request)
- Specified by:
getErrorPagein interfaceErrorHandler.ErrorPageMapper
-
getErrorPages
public java.util.Map<java.lang.String,java.lang.String> getErrorPages()
-
setErrorPages
public void setErrorPages(java.util.Map<java.lang.String,java.lang.String> errorPages)
- Parameters:
errorPages- a map of Exception class names or error codes as a string to URI string
-
addErrorPage
public void addErrorPage(java.lang.Class<? extends java.lang.Throwable> exception, java.lang.String uri)Adds ErrorPage 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- Parameters:
exception- The exceptionuri- The URI of the error page.
-
addErrorPage
public void addErrorPage(java.lang.String exceptionClassName, java.lang.String uri)Adds ErrorPage 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- Parameters:
exceptionClassName- The exceptionuri- The URI of the error page.
-
addErrorPage
public void addErrorPage(int code, java.lang.String uri)Adds ErrorPage mapping for a status code. This method is called as a result of an error-code element in a web.xml file or may be called directly.- Parameters:
code- The HTTP status code to matchuri- The URI of the error page.
-
addErrorPage
public void addErrorPage(int from, int to, java.lang.String uri)Adds ErrorPage mapping for a status code range. This method is not available from web.xml and must be called directly.- Parameters:
from- The lowest matching status codeto- The highest matching status codeuri- The URI of the error page.
-
-