类 AnnotationMethodHandlerExceptionResolver
- java.lang.Object
- org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
- org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
- 所有已实现的接口:
Ordered
,HandlerExceptionResolver
@Deprecated public class AnnotationMethodHandlerExceptionResolver extends AbstractHandlerExceptionResolver
已过时。as of Spring 3.2, in favor ofExceptionHandlerExceptionResolver
Implementation of theHandlerExceptionResolver
interface that handles exceptions through theExceptionHandler
annotation.This exception resolver is enabled by default in the
DispatcherServlet
.- 从以下版本开始:
- 3.0
- 作者:
- Arjen Poutsma, Juergen Hoeller
字段概要
从类继承的字段 org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
logger
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 构造器 说明 AnnotationMethodHandlerExceptionResolver()
已过时。
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 protected ModelAndView
doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
已过时。Actually resolve the given exception that got thrown during handler execution, returning aModelAndView
that represents a specific error page if appropriate.protected List<Class<? extends Throwable>>
getHandledExceptions(Method method)
已过时。Returns all the exception classes handled by the given method.protected Object
resolveCommonArgument(MethodParameter methodParameter, NativeWebRequest webRequest, Exception thrownException)
已过时。Resolves common method arguments.protected Object
resolveStandardArgument(Class<?> parameterType, NativeWebRequest webRequest, Exception thrownException)
已过时。Resolves standard method arguments.void
setCustomArgumentResolver(WebArgumentResolver argumentResolver)
已过时。Set a custom ArgumentResolvers to use for special method parameter types.void
setCustomArgumentResolvers(WebArgumentResolver[] argumentResolvers)
已过时。Set one or more custom ArgumentResolvers to use for special method parameter types.void
setMessageConverters(HttpMessageConverter<?>[] messageConverters)
已过时。Set the message body converters to use.从类继承的方法 org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
buildLogMessage, getOrder, logException, prepareResponse, preventCaching, resolveException, setMappedHandlerClasses, setMappedHandlers, setOrder, setPreventResponseCaching, setWarnLogCategory, shouldApplyTo
构造器详细资料
AnnotationMethodHandlerExceptionResolver
public AnnotationMethodHandlerExceptionResolver()
已过时。
方法详细资料
setCustomArgumentResolver
public void setCustomArgumentResolver(WebArgumentResolver argumentResolver)
已过时。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.
setCustomArgumentResolvers
public void setCustomArgumentResolvers(WebArgumentResolver[] argumentResolvers)
已过时。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.
setMessageConverters
public void setMessageConverters(HttpMessageConverter<?>[] messageConverters)
已过时。Set the message body converters to use.These converters are used to convert from and to HTTP requests and responses.
doResolveException
protected ModelAndView doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
已过时。从类复制的说明:AbstractHandlerExceptionResolver
Actually resolve the given exception that got thrown during handler execution, returning aModelAndView
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.
- 指定者:
doResolveException
在类中AbstractHandlerExceptionResolver
- 参数:
request
- current HTTP requestresponse
- current HTTP responsehandler
- the executed handler, ornull
if none chosen at the time of the exception (for example, if multipart resolution failed)ex
- the exception that got thrown during handler execution- 返回:
- a corresponding
ModelAndView
to forward to, ornull
for default processing in the resolution chain
getHandledExceptions
protected List<Class<? extends Throwable>> getHandledExceptions(Method method)
已过时。Returns all the exception classes handled by the given method.The default implementation looks for exceptions in the 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- 返回:
- the handled exceptions
resolveCommonArgument
protected Object resolveCommonArgument(MethodParameter methodParameter, NativeWebRequest webRequest, Exception thrownException) throws Exception
已过时。Resolves common method arguments. Delegates to registeredargumentResolvers
first, then checkingresolveStandardArgument(java.lang.Class<?>, org.springframework.web.context.request.NativeWebRequest, java.lang.Exception)
.- 参数:
methodParameter
- the method parameterwebRequest
- the requestthrownException
- the exception thrown- 返回:
- the argument value, or
WebArgumentResolver.UNRESOLVED
- 抛出:
Exception
resolveStandardArgument
protected Object resolveStandardArgument(Class<?> parameterType, NativeWebRequest webRequest, Exception thrownException) throws Exception
已过时。Resolves standard method arguments. The default implementation handlesNativeWebRequest
,ServletRequest
,ServletResponse
,HttpSession
,Principal
,Locale
, requestInputStream
, requestReader
, responseOutputStream
, responseWriter
, and the giventhrownException
.- 参数:
parameterType
- the method parameter typewebRequest
- the requestthrownException
- the exception thrown- 返回:
- the argument value, or
WebArgumentResolver.UNRESOLVED
- 抛出:
Exception