|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.web.servlet.handler.WebRequestHandlerInterceptorAdapter
public class WebRequestHandlerInterceptorAdapter
Adapter that implements the Servlet HandlerInterceptor interface and wraps an underlying WebRequestInterceptor.
WebRequestInterceptor
,
HandlerInterceptor
Constructor Summary | |
---|---|
WebRequestHandlerInterceptorAdapter(WebRequestInterceptor requestInterceptor)
Create a new WebRequestHandlerInterceptorAdapter for the given WebRequestInterceptor. |
Method Summary | |
---|---|
void |
afterCompletion(HttpServletRequest request,
HttpServletResponse response,
Object handler,
Exception ex)
Callback after completion of request processing, that is, after rendering the view. |
void |
postHandle(HttpServletRequest request,
HttpServletResponse response,
Object handler,
ModelAndView modelAndView)
Intercept the execution of a handler. |
boolean |
preHandle(HttpServletRequest request,
HttpServletResponse response,
Object handler)
Intercept the execution of a handler. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebRequestHandlerInterceptorAdapter(WebRequestInterceptor requestInterceptor)
requestInterceptor
- the WebRequestInterceptor to wrapMethod Detail |
---|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
HandlerInterceptor
DispatcherServlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can decide to abort the execution chain, typically sending a HTTP error or writing a custom response.
preHandle
in interface 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 errorspublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception
HandlerInterceptor
DispatcherServlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can post-process an execution, getting applied in inverse order of the execution chain.
postHandle
in interface HandlerInterceptor
request
- current HTTP requestresponse
- current HTTP responsehandler
- chosen handler to execute, for type and/or instance examinationmodelAndView
- the ModelAndView
that the handler returned
(can also be null
)
Exception
- in case of errorspublic void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception
HandlerInterceptor
Note: Will only be called if this interceptor's preHandle
method has successfully completed and returned true
!
afterCompletion
in interface HandlerInterceptor
request
- current HTTP requestresponse
- current HTTP responsehandler
- chosen handler to execute, for type and/or instance examinationex
- exception thrown on handler execution, if any
Exception
- in case of errors
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |