Package org.eclipse.jetty.ee11.servlet
Class ErrorPageErrorHandler
java.lang.Object
org.eclipse.jetty.server.handler.ErrorHandler
org.eclipse.jetty.ee11.servlet.ErrorHandler
org.eclipse.jetty.ee11.servlet.ErrorPageErrorHandler
- All Implemented Interfaces:
ErrorHandler.ErrorPageMapper,Request.Handler,Invocable
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.ee11.servlet.ErrorHandler
ErrorHandler.ErrorPageMapperNested classes/interfaces inherited from class org.eclipse.jetty.server.handler.ErrorHandler
ErrorHandler.ErrorRequestNested classes/interfaces inherited from interface org.eclipse.jetty.ee11.servlet.ErrorHandler.ErrorPageMapper
ErrorHandler.ErrorPageMapper.ErrorPage, ErrorHandler.ErrorPageMapper.PageLookupTechniqueNested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
Invocable.Callable, Invocable.InvocationType, Invocable.ReadyTask, Invocable.TaskNested classes/interfaces inherited from interface org.eclipse.jetty.server.Request.Handler
Request.Handler.AbortException -
Field Summary
FieldsFields inherited from class org.eclipse.jetty.server.handler.ErrorHandler
ERROR_CACHE_CONTROL, ERROR_CONTEXT, ERROR_EXCEPTION, ERROR_MESSAGE, ERROR_METHODS, ERROR_ORIGIN, ERROR_STATUSFields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking, NOOP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddErrorPage(int from, int to, String uri) Adds ErrorPage mapping for a status code range.voidaddErrorPage(int code, String uri) Adds ErrorPage mapping for a status code.voidaddErrorPage(Class<? extends Throwable> exception, String uri) Adds ErrorPage mapping for an exception class.voidaddErrorPage(String exceptionClassName, String uri) Adds ErrorPage mapping for an exception class.getErrorPage(Integer errorStatusCode, Throwable error) booleanvoidprepare(ErrorHandler.ErrorPageMapper.ErrorPage errorPage, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) voidsetErrorPages(Map<String, String> errorPages) Set a map of Exception class names or error codes as a string to URI string.voidsetUnwrapServletException(boolean unwrapServletException) Methods inherited from class org.eclipse.jetty.ee11.servlet.ErrorHandler
generateAcceptableResponse, getErrorHandler, handle, writeError, writeErrorHtmlMessageMethods inherited from class org.eclipse.jetty.server.handler.ErrorHandler
badMessageError, computeBufferSize, errorPageForMethod, generateCacheControl, generateResponse, getBufferSize, getCacheControl, getDefaultResponseMimeType, htmlRow, isShowCauses, isShowMessageInTitle, isShowOrigin, isShowStacks, setBufferSize, setCacheControl, setDefaultResponseMimeType, setShowCauses, setShowMessageInTitle, setShowOrigin, setShowStacks, toString, write, writeErrorHtml, writeErrorHtmlBody, writeErrorHtmlHead, writeErrorHtmlMeta, writeErrorHtmlStacks, writeErrorJson, writeErrorOrigin, writeErrorPlainMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.server.Request.Handler
getInvocationType
-
Field Details
-
GLOBAL_ERROR_PAGE
- See Also:
-
-
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
-
prepare
public void prepare(ErrorHandler.ErrorPageMapper.ErrorPage errorPage, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) - Specified by:
preparein interfaceErrorHandler.ErrorPageMapper
-
getErrorPage
public ErrorHandler.ErrorPageMapper.ErrorPage getErrorPage(Integer errorStatusCode, Throwable error) - Specified by:
getErrorPagein interfaceErrorHandler.ErrorPageMapper
-
getErrorPages
-
setErrorPages
Set a map of Exception class names or error codes as a string to URI string.- 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.
-