类 HandlerInterceptorAdapter
- java.lang.Object
- org.springframework.web.servlet.handler.HandlerInterceptorAdapter
- 所有已实现的接口:
AsyncHandlerInterceptor
,HandlerInterceptor
- 直接已知子类:
ConversionServiceExposingInterceptor
,LocaleChangeInterceptor
,ResourceUrlProviderExposingInterceptor
,ThemeChangeInterceptor
,UserRoleAuthorizationInterceptor
public abstract class HandlerInterceptorAdapter extends Object implements AsyncHandlerInterceptor
Abstract adapter class for theAsyncHandlerInterceptor
interface, for simplified implementation of pre-only/post-only interceptors.- 从以下版本开始:
- 05.12.2003
- 作者:
- Juergen Hoeller
构造器概要
构造器 构造器 说明 HandlerInterceptorAdapter()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
This implementation is empty.void
afterConcurrentHandlingStarted(HttpServletRequest request, HttpServletResponse response, Object handler)
This implementation is empty.void
postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView)
This implementation is empty.boolean
preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
This implementation always returnstrue
.
构造器详细资料
HandlerInterceptorAdapter
public HandlerInterceptorAdapter()
方法详细资料
preHandle
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
This implementation always returnstrue
.- 指定者:
preHandle
在接口中HandlerInterceptor
- 参数:
request
- current HTTP requestresponse
- current HTTP responsehandler
- chosen handler to execute, for type and/or instance evaluation- 返回:
true
if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherServlet assumes that this interceptor has already dealt with the response itself.- 抛出:
Exception
- in case of errors
postHandle
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception
This implementation is empty.- 指定者:
postHandle
在接口中HandlerInterceptor
- 参数:
request
- current HTTP requestresponse
- current HTTP responsehandler
- handler (orHandlerMethod
) that started asynchronous execution, for type and/or instance examinationmodelAndView
- theModelAndView
that the handler returned (can also benull
)- 抛出:
Exception
- in case of errors
afterCompletion
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception
This implementation is empty.- 指定者:
afterCompletion
在接口中HandlerInterceptor
- 参数:
request
- current HTTP requestresponse
- current HTTP responsehandler
- handler (orHandlerMethod
) that started asynchronous execution, for type and/or instance examinationex
- exception thrown on handler execution, if any- 抛出:
Exception
- in case of errors
afterConcurrentHandlingStarted
public void afterConcurrentHandlingStarted(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
This implementation is empty.- 指定者:
afterConcurrentHandlingStarted
在接口中AsyncHandlerInterceptor
- 参数:
request
- the current requestresponse
- the current responsehandler
- the handler (orHandlerMethod
) that started async execution, for type and/or instance examination- 抛出:
Exception
- in case of errors