public class DefaultErrorAttributes extends Object implements ErrorAttributes, Ordered
ErrorAttributes
. Provides the following attributes
when possible:
ObjectError
s from a BindingResult
exception
ErrorAttributes
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
DefaultErrorAttributes() |
Modifier and Type | Method and Description |
---|---|
Throwable |
getError(RequestAttributes requestAttributes)
Return the underlying cause of the error or
null if the error cannot be
extracted. |
Map<String,Object> |
getErrorAttributes(RequestAttributes requestAttributes,
boolean includeStackTrace)
Returns a
Map of the error attributes. |
int |
getOrder() |
ModelAndView |
resolveException(HttpServletRequest request,
HttpServletResponse response,
Object handler,
Exception ex) |
public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
public Map<String,Object> getErrorAttributes(RequestAttributes requestAttributes, boolean includeStackTrace)
ErrorAttributes
Map
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 ErrorAttributes
requestAttributes
- the source request attributesincludeStackTrace
- if stack trace elements should be includedpublic Throwable getError(RequestAttributes requestAttributes)
ErrorAttributes
null
if the error cannot be
extracted.getError
in interface ErrorAttributes
requestAttributes
- the source request attributesException
that caused the error or null
Copyright © 2015 Pivotal Software, Inc.. All rights reserved.