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:
org.eclipse.jetty.server.Handler
,org.eclipse.jetty.server.handler.ErrorHandler.ErrorPageMapper
,org.eclipse.jetty.util.component.Container
,org.eclipse.jetty.util.component.Destroyable
,org.eclipse.jetty.util.component.Dumpable
,org.eclipse.jetty.util.component.Dumpable.DumpableContainer
,org.eclipse.jetty.util.component.LifeCycle
public class ErrorPageErrorHandler
extends org.eclipse.jetty.server.handler.ErrorHandler
implements org.eclipse.jetty.server.handler.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
org.eclipse.jetty.server.handler.ErrorHandler.ErrorPageMapper
Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler
org.eclipse.jetty.server.handler.AbstractHandler.ErrorDispatchHandler
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainer
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener
-
Field Summary
FieldsFields inherited from class org.eclipse.jetty.server.handler.ErrorHandler
ERROR_CHARSET, ERROR_CONTEXT, ERROR_PAGE
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPING
Fields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addErrorPage
(int from, int to, String uri) Adds ErrorPage mapping for a status code range.void
addErrorPage
(int code, String uri) Adds ErrorPage mapping for a status code.void
addErrorPage
(Class<? extends Throwable> exception, String uri) Adds ErrorPage mapping for an exception class.void
addErrorPage
(String exceptionClassName, String uri) Adds ErrorPage mapping for an exception class.protected void
doStart()
getErrorPage
(jakarta.servlet.http.HttpServletRequest request) boolean
void
setErrorPages
(Map<String, String> errorPages) void
setUnwrapServletException
(boolean unwrapServletException) Methods inherited from class org.eclipse.jetty.server.handler.ErrorHandler
badMessageError, errorPageForMethod, generateAcceptableResponse, generateAcceptableResponse, getAcceptableWriter, getCacheControl, getErrorHandler, getShowMessageInTitle, handle, handleErrorPage, isShowServlet, isShowStacks, setCacheControl, setShowMessageInTitle, setShowServlet, setShowStacks, write, writeErrorPage, writeErrorPageBody, writeErrorPageHead, writeErrorPageMessage, writeErrorPageStacks
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
destroy, doError, doStop, getServer, setServer
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListeners
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelf
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop
-
Field Details
-
GLOBAL_ERROR_PAGE
- See Also:
-
_servletContext
protected jakarta.servlet.ServletContext _servletContext
-
-
Constructor Details
-
ErrorPageErrorHandler
public ErrorPageErrorHandler()
-
-
Method Details
-
isUnwrapServletException
public boolean isUnwrapServletException()- Returns:
- True if ServletException is unwrapped for
RequestDispatcher.ERROR_EXCEPTION
-
setUnwrapServletException
public void setUnwrapServletException(boolean unwrapServletException) - Parameters:
unwrapServletException
- True if ServletException should be unwrapped forRequestDispatcher.ERROR_EXCEPTION
-
getErrorPage
- Specified by:
getErrorPage
in interfaceorg.eclipse.jetty.server.handler.ErrorHandler.ErrorPageMapper
-
getErrorPages
-
setErrorPages
- Parameters:
errorPages
- a map of Exception class names or error codes as a string to URI string
-
addErrorPage
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
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
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
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.
-
doStart
- Overrides:
doStart
in classorg.eclipse.jetty.server.handler.AbstractHandler
- Throws:
Exception
-