org.springframework.web.context.request.WebRequestInterceptor , org.springframework.web.servlet.HandlerInterceptor
| Modifier and Type | Field and Description |
|---|---|
| private final WebRequestInterceptor |
| Access | Constructor and Description |
|---|---|
| public | WebRequestHandlerInterceptorAdapter(WebRequestInterceptor
the WebRequestInterceptor to wrap requestInterceptor)Create a new WebRequestHandlerInterceptorAdapter for the given WebRequestInterceptor. |
| Modifier and Type | Method and Description |
|---|---|
| public void | afterCompletion(HttpServletRequest
current HTTP request request, HttpServletResponse current HTTP response response, Object the handler (or handler, Exception HandlerMethod) that started asynchronous
execution, for type and/or instance examinationany exception thrown on handler execution, if any; this does not
include exceptions that have been handled through an exception resolver ex)Overrides default org. Callback after completion of request processing, that is, after rendering the view. |
| public void | afterConcurrentHandlingStarted(HttpServletRequest
the current request request, HttpServletResponse the current response response, Object the handler (or handler)HandlerMethod) that started async
execution, for type and/or instance examinationOverrides default org. Called instead of |
| public void | postHandle(HttpServletRequest
current HTTP request request, HttpServletResponse current HTTP response response, Object the handler (or handler, ModelAndView HandlerMethod) that started asynchronous
execution, for type and/or instance examinationthe modelAndView)ModelAndView that the handler returned
(can also be null)Overrides default org. Interception point after successful execution of a handler. |
| public boolean | preHandle(HttpServletRequest
current HTTP request request, HttpServletResponse current HTTP response response, Object chosen handler to execute, for type and/or instance evaluation handler)Overrides default org. Interception point before the execution of a handler. |
| requestInterceptor | back to summary |
|---|---|
| private final WebRequestInterceptor requestInterceptor | |
| WebRequestHandlerInterceptorAdapter | back to summary |
|---|---|
| public WebRequestHandlerInterceptorAdapter(WebRequestInterceptor requestInterceptor) Create a new WebRequestHandlerInterceptorAdapter for the given WebRequestInterceptor.
| |
| afterCompletion | back to summary |
|---|---|
| public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception Overrides default org. Doc from org. Callback after completion of request processing, that is, after rendering the view. Will be called on any outcome of handler execution, thus allows for proper resource cleanup. Note Will only be called if this interceptor's As with the Note special considerations apply for asynchronous
request processing. For more details see
The default implementation is empty.
| |
| afterConcurrentHandlingStarted | back to summary |
|---|---|
| public void afterConcurrentHandlingStarted(HttpServletRequest request, HttpServletResponse response, Object handler) Overrides default org. Doc from org. Called instead of Implementations may use the provided request and response but should avoid modifying them in ways that would conflict with the concurrent execution of the handler. A typical use of this method would be to clean up thread-local variables.
| |
| postHandle | back to summary |
|---|---|
| public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception Overrides default org. Doc from org. Interception point after successful execution of a handler. Called after HandlerAdapter actually invoked the handler, but before the DispatcherServlet renders the view. Can expose additional model objects to the view via the given ModelAndView. 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. Note special considerations apply for asynchronous
request processing. For more details see
The default implementation is empty.
| |
| preHandle | back to summary |
|---|---|
| public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception Overrides default org. Doc from org. Interception point before the execution of a handler. Called after HandlerMapping determined an appropriate handler object, but before HandlerAdapter invokes the handler. 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 an HTTP error or writing a custom response. Note special considerations apply for asynchronous
request processing. For more details see
The default implementation returns
| |