您可以实现 * 它具有一个method
,它具有您需要的两个参数:
HandlerInterceptor__
postHandle
Object handler
-可以转换为HandlerMethod
,包含有关已处理请求的Controller方法的信息ModelAndView
-您需要在其中添加有关处理方法的新信息
完整的方法签名
org.springframework.web.servlet.HandlerInterceptor#postHandle:
void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception;
*HandlerInterceptor
可以直接扩展,而不是直接实现HandlerInterceptorAdapter
-这是一个方便的抽象类,它HandlerInterceptor
以空主体实现所有方法,因此只需要覆盖所需的方法即可。
*不要感到困惑,这里有两个HandlerInterceptor
类,一个用于Servlet,一个用于Portlet(org.springframework.web.portlet.HandlerInterceptor
)。使用HandlerInterceptor
for
Servlet oorg.springframework.web.servlet.HandlerInterceptor
!



