Class HandlerInterceptorAdapter
- java.lang.Object
- org.springframework.web.servlet.handler.HandlerInterceptorAdapter
- All Implemented Interfaces:
AsyncHandlerInterceptor
,HandlerInterceptor
- Direct Known Subclasses:
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.- Since:
- 05.12.2003
- Author:
- Juergen Hoeller
Constructor Summary
Constructors Constructor Description HandlerInterceptorAdapter()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
.
Constructor Detail
HandlerInterceptorAdapter
public HandlerInterceptorAdapter()
Method Detail
preHandle
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
This implementation always returnstrue
.- Specified by:
preHandle
in interfaceHandlerInterceptor
- Parameters:
request
- current HTTP requestresponse
- current HTTP responsehandler
- chosen handler to execute, for type and/or instance evaluation- Returns:
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.- Throws:
Exception
- in case of errors
postHandle
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception
This implementation is empty.- Specified by:
postHandle
in interfaceHandlerInterceptor
- Parameters:
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
)- Throws:
Exception
- in case of errors
afterCompletion
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception
This implementation is empty.- Specified by:
afterCompletion
in interfaceHandlerInterceptor
- Parameters:
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- Throws:
Exception
- in case of errors
afterConcurrentHandlingStarted
public void afterConcurrentHandlingStarted(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
This implementation is empty.- Specified by:
afterConcurrentHandlingStarted
in interfaceAsyncHandlerInterceptor
- Parameters:
request
- the current requestresponse
- the current responsehandler
- the handler (orHandlerMethod
) that started async execution, for type and/or instance examination- Throws:
Exception
- in case of errors