Class DefaultErrorViewResolver
java.lang.Object
org.springframework.boot.webmvc.autoconfigure.error.DefaultErrorViewResolver
- All Implemented Interfaces:
ErrorViewResolver, Ordered
Default
ErrorViewResolver implementation that attempts to resolve error views
using well known conventions. Will search for templates and static assets under
'/error' using the status code and the
status series.
For example, an HTTP 404 will search (in the specific order):
'/<templates>/error/404.<ext>''/<static>/error/404.html''/<templates>/error/4xx.<ext>''/<static>/error/4xx.html'
- Since:
- 4.0.0
- Author:
- Phillip Webb, Andy Wilkinson
-
Field Summary
Fields inherited from interface Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionDefaultErrorViewResolver(ApplicationContext applicationContext, WebProperties.Resources resources) Create a newDefaultErrorViewResolverinstance. -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()@Nullable ModelAndViewresolveErrorView(HttpServletRequest request, HttpStatus status, Map<String, Object> model) Resolve an error view for the specified details.voidsetOrder(int order)
-
Constructor Details
-
DefaultErrorViewResolver
public DefaultErrorViewResolver(ApplicationContext applicationContext, WebProperties.Resources resources) Create a newDefaultErrorViewResolverinstance.- Parameters:
applicationContext- the source application contextresources- resource properties
-
-
Method Details
-
resolveErrorView
public @Nullable ModelAndView resolveErrorView(HttpServletRequest request, HttpStatus status, Map<String, Object> model) Description copied from interface:ErrorViewResolverResolve an error view for the specified details.- Specified by:
resolveErrorViewin interfaceErrorViewResolver- Parameters:
request- the source requeststatus- the http status of the errormodel- the suggested model to be used with the view- Returns:
- a resolved
ModelAndViewornull
-
getOrder
-
setOrder
public void setOrder(int order)
-