java.lang.Object | ||
↳ | org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver | |
↳ | org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver |
Implementation of the HandlerExceptionResolver
interface that handles
exceptions through the ExceptionHandler
annotation.
This exception resolver is enabled by default in the DispatcherServlet
.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
org.springframework.core.Ordered
|
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Set a custom ArgumentResolvers to use for special method parameter types.
| |||||||||||
Set one or more custom ArgumentResolvers to use for special method parameter types.
| |||||||||||
Set the message body converters to use.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Actually resolve the given exception that got thrown during on handler execution,
returning a ModelAndView that represents a specific error page if appropriate.
| |||||||||||
Returns all the exception classes handled by the given method.
| |||||||||||
Resolves common method arguments.
| |||||||||||
Resolves standard method arguments.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.core.Ordered
| |||||||||||
From interface
org.springframework.web.servlet.HandlerExceptionResolver
|
Set a custom ArgumentResolvers to use for special method parameter types.
Such a custom ArgumentResolver will kick in first, having a chance to resolve an argument value before the standard argument handling kicks in.
Set one or more custom ArgumentResolvers to use for special method parameter types.
Any such custom ArgumentResolver will kick in first, having a chance to resolve an argument value before the standard argument handling kicks in.
Set the message body converters to use.
These converters are used to convert from and to HTTP requests and responses.
Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
May be overridden in subclasses, in order to apply specific exception checks. Note that this template method will be invoked after checking whether this resolved applies ("mappedHandlers" etc), so an implementation may simply proceed with its actual exception handling.
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 |
null
for default processing
Returns all the exception classes handled by the given method.
The default implementation looks for exceptions in the ExceptionHandler#value() annotation,
or - if that annotation element is empty - any exceptions listed in the method parameters if the method
is annotated with @ExceptionHandler
.
method | the method |
---|
Resolves common method arguments. Delegates to registered argumentResolvers
first, then checking resolveStandardArgument(Class, NativeWebRequest, Exception)
.
methodParameter | the method parameter |
---|---|
webRequest | the request |
thrownException | the exception thrown |
UNRESOLVED
Exception |
---|
Resolves standard method arguments. The default implementation handles NativeWebRequest
,
ServletRequest, ServletResponse, HttpSession, Principal
,
Locale
, request InputStream
, request Reader
, response OutputStream
,
response Writer
, and the given thrownException
.
parameterType | the method parameter type |
---|---|
webRequest | the request |
thrownException | the exception thrown |
UNRESOLVED
Exception |
---|