Package org.springframework.web.servlet.handler

# Class HandlerExceptionResolverComposite

java.lang.Object
org.springframework.web.servlet.handler.HandlerExceptionResolverComposite

All Implemented Interfaces:
  `org.springframework.core.Ordered`, `HandlerExceptionResolver`

public class HandlerExceptionResolverComposite extends Object implements HandlerExceptionResolver, org.springframework.core.Ordered
A `HandlerExceptionResolver` that delegates to a list of other `HandlerExceptionResolvers`.

Since:
  3.1
Author:
  Rossen Stoyanchev

## Field Summary

### Fields inherited from interface org.springframework.core.Ordered

`HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

## Constructor Summary

Constructors
Constructor
Description
`HandlerExceptionResolverComposite()`

## Method Summary

Modifier and Type
Method
Description
`List<HandlerExceptionResolver>`
`getExceptionResolvers()`
Return the list of exception resolvers to delegate to.
`int`
`getOrder()`
`ModelAndView`
`resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)`
Resolve the exception by iterating over the list of configured exception resolvers.
`void`
`setExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)`
Set the list of exception resolvers to delegate to.
`void`
`setOrder(int order)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### HandlerExceptionResolverComposite

public HandlerExceptionResolverComposite()

## Method Details

### setExceptionResolvers

public void setExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)
Set the list of exception resolvers to delegate to.

### getExceptionResolvers

public List<HandlerExceptionResolver> getExceptionResolvers()
Return the list of exception resolvers to delegate to.

### setOrder

public void setOrder(int order)

### getOrder

public int getOrder()

Specified by:
  `getOrder` in interface `org.springframework.core.Ordered`

### resolveException

@Nullable public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, @Nullable Object handler, Exception ex)
Resolve the exception by iterating over the list of configured exception resolvers.

The first one to return a `ModelAndView` wins. Otherwise `null` is returned.

Specified by:
  `resolveException` in interface `HandlerExceptionResolver`
Parameters:
  `request` - current HTTP request
  `response` - current HTTP response
  `handler` - 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 execution
Returns:
  a corresponding `ModelAndView` to forward to, or `null` for default processing in the resolution chain