public abstract class

HandlerInterceptorAdapter

extends Object
implements HandlerInterceptor
java.lang.Object
   ↳ org.springframework.web.servlet.handler.HandlerInterceptorAdapter
Known Direct Subclasses

Class Overview

Abstract adapter class for the HandlerInterceptor interface, for simplified implementation of pre-only/post-only interceptors.

Summary

Public Constructors
HandlerInterceptorAdapter()
Public Methods
void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
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 returns true.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.web.servlet.HandlerInterceptor

Public Constructors

public HandlerInterceptorAdapter ()

Public Methods

public void afterCompletion (HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)

This implementation is empty.

Parameters
request current HTTP request
response current HTTP response
handler chosen handler to execute, for type and/or instance examination
ex exception thrown on handler execution, if any
Throws
Exception

public void postHandle (HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView)

This implementation is empty.

Parameters
request current HTTP request
response current HTTP response
handler chosen handler to execute, for type and/or instance examination
modelAndView the ModelAndView that the handler returned (can also be null)
Throws
Exception

public boolean preHandle (HttpServletRequest request, HttpServletResponse response, Object handler)

This implementation always returns true.

Parameters
request current HTTP request
response current HTTP response
handler 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