java.lang.Object | ||
↳ | org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver | |
↳ | org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver |
Implementation of the HandlerExceptionResolver
interface that uses the @ResponseStatus
annotation to map exceptions to HTTP status codes.
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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.
| |||||||||||
Template method that handles
@ResponseStatus annotation. |
[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
|
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
Template method that handles @ResponseStatus
annotation.
Default implementation send a
response error using sendError(int)
, or sendError(int, String)
if the annotation has a ResponseStatus#reason() reason. Returns an empty ModelAndView.
responseStatus | the annotation |
---|---|
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
Exception |
---|