|
spring-webmvc | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.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(org.springframework.web.context.request.WebRequestInterceptor requestInterceptor)
Create a new WebRequestHandlerInterceptorAdapter for the given WebRequestInterceptor. |
|
| Method Summary | |
|---|---|
void |
afterCompletion(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler,
java.lang.Exception ex)
Callback after completion of request processing, that is, after rendering the view. |
org.springframework.web.context.request.async.AbstractDelegatingCallable |
getAsyncCallable(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler)
Invoked after #preHandle(WebRequest) and before
the handler is executed. |
void |
postHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler,
ModelAndView modelAndView)
Intercept the execution of a handler. |
void |
postHandleAsyncStarted(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler)
Invoked after the execution of a handler if the handler started async processing instead of handling the request. |
boolean |
preHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.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(org.springframework.web.context.request.WebRequestInterceptor requestInterceptor)
requestInterceptor - the WebRequestInterceptor to wrap| Method Detail |
|---|
public boolean preHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler)
throws java.lang.Exception
HandlerInterceptorDispatcherServlet 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 HandlerInterceptorrequest - 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.
java.lang.Exception - in case of errors
public org.springframework.web.context.request.async.AbstractDelegatingCallable getAsyncCallable(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler)
AsyncHandlerInterceptor#preHandle(WebRequest) and before
the handler is executed. The returned Callable is used only if
handler execution leads to teh start of async processing. It is invoked
the async thread before the request is handled fro.
Implementations can use this Callable to initialize
ThreadLocal attributes on the async thread.
getAsyncCallable in interface AsyncHandlerInterceptorrequest - current HTTP requestresponse - current HTTP responsehandler - chosen handler to execute, for type and/or instance examination
Callable instance or null
public void postHandleAsyncStarted(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler)
AsyncHandlerInterceptor#postHandle(WebRequest, org.springframework.ui.ModelMap). The
postHandle method is invoked after the request is handled
in the async thread.
Implementations of this method can ensure ThreadLocal attributes bound to the main thread are cleared and also prepare for binding them to the async thread.
postHandleAsyncStarted in interface AsyncHandlerInterceptorrequest - current HTTP requestresponse - current HTTP responsehandler - chosen handler to execute, for type and/or instance examination
public void postHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler,
ModelAndView modelAndView)
throws java.lang.Exception
HandlerInterceptorDispatcherServlet 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 HandlerInterceptorrequest - 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)
java.lang.Exception - in case of errors
public void afterCompletion(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler,
java.lang.Exception ex)
throws java.lang.Exception
HandlerInterceptorNote: Will only be called if this interceptor's preHandle
method has successfully completed and returned true!
As with the postHandle method, the method will be invoked on each
interceptor in the chain in reverse order, so the first interceptor will be
the last to be invoked.
afterCompletion in interface HandlerInterceptorrequest - current HTTP requestresponse - current HTTP responsehandler - chosen handler to execute, for type and/or instance examinationex - exception thrown on handler execution, if any
java.lang.Exception - in case of errors
|
spring-webmvc | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||