RequestLog
}.
@author Michael Lipp
In the previous example the {@link RequestScope.Instance request scope instance}was suspended and retrieved which also informs {@code requestScope} that itshould not automatically release the instance once the running task is finished. The {@code requestScopeInstance} is then used to initialize the nextrequest-scoped execution. The second task will run in the same request scope as the first task. At the end the suspended {@code requestScopeInstance} must bemanually {@link RequestScope.Instance#release released}. Not releasing the instance could cause memory leaks. Please note that calling {@link RequestScope#suspendCurrent}does not retrieve an immutable snapshot of the current request scope but a live reference to the internal {@link RequestScope.Instance request scope instance}which may change it's state during each request-scoped task execution for which this scope instance is used.
@author Marek Potociar (marek.potociar at oracle.com) @author Miroslav Fuksa (miroslav.fuksa at oracle.com)Relies on a thread-bound {@link RequestAttributes} instance, whichcan be exported through {@link RequestContextListener}, {@link org.springframework.web.filter.RequestContextFilter} or{@link org.springframework.web.servlet.DispatcherServlet}.
This Scope
will also work for Portlet environments, through an alternate RequestAttributes
implementation (as exposed out-of-the-box by Spring's {@link org.springframework.web.portlet.DispatcherPortlet}.
@author Rod Johnson
@author Juergen Hoeller
@author Rob Harrop
@since 2.0
@see RequestContextHolder#currentRequestAttributes()
@see RequestAttributes#SCOPE_REQUEST
@see RequestContextListener
@see org.springframework.web.filter.RequestContextFilter
@see org.springframework.web.servlet.DispatcherServlet
@see org.springframework.web.portlet.DispatcherPortlet
|
|
|
|
|
|