Class DefaultErrorViewResolver
- java.lang.Object
- org.springframework.boot.autoconfigure.web.DefaultErrorViewResolver
- All Implemented Interfaces:
ErrorViewResolver,org.springframework.core.Ordered
public class DefaultErrorViewResolver extends Object implements ErrorViewResolver, org.springframework.core.Ordered
DefaultErrorViewResolverimplementation that attempts to resolve error views using well known conventions. Will search for templates and static assets under'/error'using thestatus codeand thestatus series.For example, an
HTTP 404will search (in the specific order):'/<templates>/error/404.<ext>''/<static>/error/404.html''/<templates>/error/4xx.<ext>''/<static>/error/4xx.html'
- Since:
- 1.4.0
Constructor Summary
Constructors Constructor Description DefaultErrorViewResolver(org.springframework.context.ApplicationContext applicationContext, ResourceProperties resourceProperties)Create a newDefaultErrorViewResolverinstance.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetOrder()org.springframework.web.servlet.ModelAndViewresolveErrorView(javax.servlet.http.HttpServletRequest request, org.springframework.http.HttpStatus status, Map<String,Object> model)Resolve an error view for the specified details.voidsetOrder(int order)
Constructor Detail
DefaultErrorViewResolver
public DefaultErrorViewResolver(org.springframework.context.ApplicationContext applicationContext, ResourceProperties resourceProperties)
Create a newDefaultErrorViewResolverinstance.- Parameters:
applicationContext- the source application contextresourceProperties- resource properties
Method Detail
resolveErrorView
public org.springframework.web.servlet.ModelAndView resolveErrorView(javax.servlet.http.HttpServletRequest request, org.springframework.http.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
public int getOrder()
- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
setOrder
public void setOrder(int order)