类 SimpleActionMappingMethodExceptionHandler
java.lang.Object
cn.taketoday.core.OrderedSupport
cn.taketoday.web.handler.AbstractHandlerExceptionHandler
cn.taketoday.web.handler.AbstractActionMappingMethodExceptionHandler
cn.taketoday.web.handler.SimpleActionMappingMethodExceptionHandler
- 所有已实现的接口:
cn.taketoday.core.Ordered,HandlerExceptionHandler
@Experimental
public class SimpleActionMappingMethodExceptionHandler
extends AbstractActionMappingMethodExceptionHandler
write 'classpath:error/xxx.png' for RenderedImage
- 从以下版本开始:
- 4.0 2022/3/3 11:28
- 作者:
- Harry Yang
-
字段概要
从类继承的字段 cn.taketoday.web.handler.AbstractHandlerExceptionHandler
logger从类继承的字段 cn.taketoday.core.OrderedSupport
order从接口继承的字段 cn.taketoday.web.HandlerExceptionHandler
BEAN_NAME, NONE_RETURN_VALUE从接口继承的字段 cn.taketoday.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected StringintGet error http status value, if target throwable isHttpStatusCodeProviderits return fromHttpStatusCodeProvider.getStatusCode()protected ObjecthandleInternal(RequestContext context, HandlerMethod handlerMethod, Throwable ex) Actually resolve the given exception that got thrown during on handler execution, returning a view(result) that represents a specific error page if appropriate.protected voidwriteErrorMessage(Throwable ex, RequestContext context) Write error message to request context, default is write json从类继承的方法 cn.taketoday.web.handler.AbstractActionMappingMethodExceptionHandler
handleInternal, hasGlobalExceptionHandlers, shouldApplyTo从类继承的方法 cn.taketoday.web.handler.AbstractHandlerExceptionHandler
addMappedHandlerClass, buildLogMessage, getMappedHandlerClasses, handleException, hasHandlerMappings, logException, logResultedInException, prepareResponse, preventCaching, setMappedHandlerClasses, setMappedHandlers, setPreventResponseCaching, setWarnLogCategory从类继承的方法 cn.taketoday.core.OrderedSupport
getOrder, setOrder
-
构造器详细资料
-
SimpleActionMappingMethodExceptionHandler
public SimpleActionMappingMethodExceptionHandler()
-
-
方法详细资料
-
handleInternal
@Nullable protected Object handleInternal(RequestContext context, @Nullable HandlerMethod handlerMethod, Throwable ex) throws Exception Actually resolve the given exception that got thrown during on handler execution, returning a view(result) 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.
- 指定者:
handleInternal在类中AbstractActionMappingMethodExceptionHandler- 参数:
context- current HTTP requesthandlerMethod- the executed handler method, ornullif 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, or
nullfor default processing - 抛出:
Exception
-
writeErrorMessage
Write error message to request context, default is write json- 参数:
ex- Throwable that occurred in request handlercontext- current request context- 抛出:
IOException
-
buildDefaultErrorMessage
-
getErrorStatusValue
Get error http status value, if target throwable isHttpStatusCodeProviderits return fromHttpStatusCodeProvider.getStatusCode()- 参数:
ex- Throwable that occurred in request handler- 返回:
- Http status code
-