|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
public class AnnotationMethodHandlerExceptionResolver
Implementation of the HandlerExceptionResolver
interface that handles
exceptions through the ExceptionHandler
annotation.
This exception resolver is enabled by default in the DispatcherPortlet
.
Field Summary |
---|
Fields inherited from class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver |
---|
logger |
Fields inherited from interface org.springframework.core.Ordered |
---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Constructor Summary | |
---|---|
AnnotationMethodHandlerExceptionResolver()
|
Method Summary | |
---|---|
protected ModelAndView |
doResolveException(PortletRequest request,
MimeResponse response,
Object handler,
Exception ex)
Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView 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. |
Methods inherited from class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver |
---|
buildLogMessage, getOrder, logException, resolveException, resolveException, setMappedHandlerClasses, setMappedHandlers, setOrder, setRenderWhenMinimized, setWarnLogCategory, shouldApplyTo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationMethodHandlerExceptionResolver()
Method Detail |
---|
public void setCustomArgumentResolver(WebArgumentResolver argumentResolver)
Such a custom ArgumentResolver will kick in first, having a chance to resolve an argument value before the standard argument handling kicks in.
public void setCustomArgumentResolvers(WebArgumentResolver[] argumentResolvers)
Any such custom ArgumentResolver will kick in first, having a chance to resolve an argument value before the standard argument handling kicks in.
protected ModelAndView doResolveException(PortletRequest request, MimeResponse response, Object handler, Exception ex)
AbstractHandlerExceptionResolver
Must 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
in class AbstractHandlerExceptionResolver
request
- current portlet requestresponse
- current portlet responsehandler
- 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
protected List<Class<? extends Throwable>> getHandledExceptions(Method method)
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
protected Object resolveCommonArgument(MethodParameter methodParameter, NativeWebRequest webRequest, Exception thrownException) throws Exception
argumentResolvers
first,
then checking resolveStandardArgument(java.lang.Class, org.springframework.web.context.request.NativeWebRequest, java.lang.Exception)
.
methodParameter
- the method parameterwebRequest
- the requestthrownException
- the exception thrown
WebArgumentResolver.UNRESOLVED
Exception
protected Object resolveStandardArgument(Class parameterType, NativeWebRequest webRequest, Exception thrownException) throws Exception
NativeWebRequest
,
ServletRequest
, ServletResponse
, HttpSession
, Principal
,
Locale
, request InputStream
, request Reader
, response OutputStream
,
response Writer
, and the given thrownException
.
parameterType
- the method parameter typewebRequest
- the requestthrownException
- the exception thrown
WebArgumentResolver.UNRESOLVED
Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |