@Order(value=-2147483648) public class DefaultErrorAttributes extends Object implements ErrorAttributes, HandlerExceptionResolver, Ordered
ErrorAttributes. Provides the following attributes
when possible:
ObjectErrors from a BindingResult exception
ErrorAttributesHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
DefaultErrorAttributes()
Create a new
DefaultErrorAttributes instance that does not include the
"exception" attribute. |
DefaultErrorAttributes(boolean includeException)
Create a new
DefaultErrorAttributes instance. |
| Modifier and Type | Method and Description |
|---|---|
Throwable |
getError(WebRequest webRequest)
Return the underlying cause of the error or
null if the error cannot be
extracted. |
Map<String,Object> |
getErrorAttributes(WebRequest webRequest,
boolean includeStackTrace)
Returns a
Map of the error attributes. |
int |
getOrder() |
ModelAndView |
resolveException(HttpServletRequest request,
HttpServletResponse response,
Object handler,
Exception ex) |
public DefaultErrorAttributes()
DefaultErrorAttributes instance that does not include the
"exception" attribute.public DefaultErrorAttributes(boolean includeException)
DefaultErrorAttributes instance.includeException - whether to include the "exception" attributepublic ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
resolveException in interface HandlerExceptionResolverpublic Map<String,Object> getErrorAttributes(WebRequest webRequest, boolean includeStackTrace)
ErrorAttributesMap of the error attributes. The map can be used as the model of
an error page ModelAndView, or returned as a ResponseBody.getErrorAttributes in interface ErrorAttributeswebRequest - the source requestincludeStackTrace - if stack trace elements should be includedpublic Throwable getError(WebRequest webRequest)
ErrorAttributesnull if the error cannot be
extracted.getError in interface ErrorAttributeswebRequest - the source requestException that caused the error or nullCopyright © 2018 Pivotal Software, Inc.. All rights reserved.