public class DefaultErrorAttributesX
extends org.springframework.boot.web.servlet.error.DefaultErrorAttributes
| Constructor and Description |
|---|
DefaultErrorAttributesX()
Create a new
DefaultErrorAttributesX instance that included the
"exception" attribute , can not get the "exception" instance. |
DefaultErrorAttributesX(boolean usingException)
Create a new
DefaultErrorAttributesX instance. |
| Modifier and Type | Method and Description |
|---|---|
protected String |
getError(Map<String,Object> errorAttributes) |
Map<String,Object> |
getErrorAttributes(org.springframework.web.context.request.WebRequest webRequest,
boolean includeStackTrace)
Returns a
Map of the error attributes that has
exception, handler, message, error, timestamp, status, path params. |
protected Exception |
getHandlerExecutionException()
Returns current handler execution 's instance, may be null.
|
protected String |
getMessage(Map<String,Object> errorAttributes)
Deprecated.
|
protected Integer |
getStatus(Map<String,Object> errorAttributes)
Current Request's status
|
org.springframework.web.servlet.ModelAndView |
resolveException(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler,
Exception exception)
Try to resolve the given exception that got thrown during handler execution,
returning a
ModelAndView that represents a specific error page if appropriate. |
protected boolean |
responseOK(Map<String,Object> errorAttributes) |
public DefaultErrorAttributesX()
DefaultErrorAttributesX instance that included the
"exception" attribute , can not get the "exception" instance.public DefaultErrorAttributesX(boolean usingException)
DefaultErrorAttributesX instance.
default included the "exception" attribute.usingException - whether to get the "exception" instance.public Map<String,Object> getErrorAttributes(org.springframework.web.context.request.WebRequest webRequest, boolean includeStackTrace)
Map of the error attributes that has
exception, handler, message, error, timestamp, status, path params.
The map can be used as the model of an error page ModelAndView,
or returned as a ResponseBody.getErrorAttributes in interface org.springframework.boot.web.servlet.error.ErrorAttributesgetErrorAttributes in class org.springframework.boot.web.servlet.error.DefaultErrorAttributeswebRequest - the source requestincludeStackTrace - if stack trace elements should be includedpublic org.springframework.web.servlet.ModelAndView resolveException(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler,
Exception exception)
ModelAndView that represents a specific error page if appropriate.
The returned ModelAndView may be empty
to indicate that the exception has been resolved successfully but that no view
should be rendered, for instance by setting a status code.
resolveException in interface org.springframework.web.servlet.HandlerExceptionResolverresolveException in class org.springframework.boot.web.servlet.error.DefaultErrorAttributesrequest - current HTTP requestresponse - current HTTP responsehandler - the executed handler, or null if none chosen at the
time of the exception (for example, if multipart resolution failed)exception - the exception that got thrown during handler executionModelAndView to forward to,
or null for default processing in the resolution chainprotected Exception getHandlerExecutionException()
protected Integer getStatus(Map<String,Object> errorAttributes)
org.springframework.http.HttpStatus}@Deprecated protected String getMessage(Map<String,Object> errorAttributes)
Copyright © 2021. All rights reserved.