Top Description Fields Constructors Methods
org.springframework.web.servlet.handler

public Class HandlerExceptionResolverComposite

extends Object
implements HandlerExceptionResolver, Ordered
Class Inheritance
All Implemented Interfaces
org.springframework.core.Ordered, org.springframework.web.servlet.HandlerExceptionResolver
Imports
java.util.Collections, .List, jakarta.servlet.http.HttpServletRequest, .HttpServletResponse, org.springframework.core.Ordered, org.springframework.lang.Nullable, org.springframework.web.servlet.HandlerExceptionResolver, .ModelAndView

A HandlerExceptionResolver that delegates to a list of other HandlerExceptionResolvers.
Author
Rossen Stoyanchev
Since
3.1

Field Summary

Modifier and TypeField and Description
private int
private List<HandlerExceptionResolver>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public List<HandlerExceptionResolver>
getExceptionResolvers()

Return the list of exception resolvers to delegate to.

public int
getOrder()

Implements org.springframework.core.Ordered.getOrder.

Get the order value of this object.

public ModelAndView
resolveException(HttpServletRequest
current HTTP request
request
,
HttpServletResponse
current HTTP response
response
,
Object
the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
handler
,
Exception
the exception that got thrown during handler execution
ex
)

Implements org.springframework.web.servlet.HandlerExceptionResolver.resolveException.

Resolve the exception by iterating over the list of configured exception resolvers.

public void
setExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)

Set the list of exception resolvers to delegate to.

public void
setOrder(int order)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

orderback to summary
private int order
resolversback to summary
private List<HandlerExceptionResolver> resolvers
Annotations
@Nullable

Constructor Detail

HandlerExceptionResolverCompositeback to summary
public HandlerExceptionResolverComposite()

Method Detail

getExceptionResolversback to summary
public List<HandlerExceptionResolver> getExceptionResolvers()

Return the list of exception resolvers to delegate to.

getOrderback to summary
public int getOrder()

Implements org.springframework.core.Ordered.getOrder.

Doc from org.springframework.core.Ordered.getOrder.

Get the order value of this object.

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.

Returns:int

the order value

Annotations
@Override
resolveExceptionback to summary
public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)

Implements org.springframework.web.servlet.HandlerExceptionResolver.resolveException.

Resolve the exception by iterating over the list of configured exception resolvers.

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

Parameters
request:HttpServletRequest

Doc from org.springframework.web.servlet.HandlerExceptionResolver.resolveException.

current HTTP request

response:HttpServletResponse

Doc from org.springframework.web.servlet.HandlerExceptionResolver.resolveException.

current HTTP response

handler:Object

Doc from org.springframework.web.servlet.HandlerExceptionResolver.resolveException.

the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)

ex:Exception

Doc from org.springframework.web.servlet.HandlerExceptionResolver.resolveException.

the exception that got thrown during handler execution

Returns:ModelAndView

Doc from org.springframework.web.servlet.HandlerExceptionResolver.resolveException.

a corresponding ModelAndView to forward to, or null for default processing in the resolution chain

Annotations
@Override
@Nullable
setExceptionResolversback to summary
public void setExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)

Set the list of exception resolvers to delegate to.

setOrderback to summary
public void setOrder(int order)