public class HandlerExceptionResolverComposite extends java.lang.Object implements HandlerExceptionResolver, Ordered
HandlerExceptionResolver
that delegates to a list of other HandlerExceptionResolver
s.Modifier and Type | Field and Description |
---|---|
private int |
order |
private java.util.List<HandlerExceptionResolver> |
resolvers |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
HandlerExceptionResolverComposite() |
Modifier and Type | Method and Description |
---|---|
java.util.List<HandlerExceptionResolver> |
getExceptionResolvers()
Return the list of exception resolvers to delegate to.
|
int |
getOrder()
Get the order value of this object.
|
ModelAndView |
resolveException(HttpServletRequest request,
HttpServletResponse response,
java.lang.Object handler,
java.lang.Exception ex)
Resolve the exception by iterating over the list of configured exception resolvers.
|
void |
setExceptionResolvers(java.util.List<HandlerExceptionResolver> exceptionResolvers)
Set the list of exception resolvers to delegate to.
|
void |
setOrder(int order) |
@Nullable private java.util.List<HandlerExceptionResolver> resolvers
private int order
public void setExceptionResolvers(java.util.List<HandlerExceptionResolver> exceptionResolvers)
public java.util.List<HandlerExceptionResolver> getExceptionResolvers()
public void setOrder(int order)
public int getOrder()
Ordered
Higher values are interpreted as lower priority. As a consequence,
the object with the lowest value has the highest priority (somewhat
analogous to Servlet load-on-startup
values).
Same order values will result in arbitrary sort positions for the affected objects.
getOrder
in interface Ordered
Ordered.HIGHEST_PRECEDENCE
,
Ordered.LOWEST_PRECEDENCE
@Nullable public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, @Nullable java.lang.Object handler, java.lang.Exception ex)
null
is returned.resolveException
in interface HandlerExceptionResolver
request
- 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)ex
- the exception that got thrown during handler executionModelAndView
to forward to, or null
for default processing