Class RequestScope
- java.lang.Object
- org.springframework.web.context.request.AbstractRequestAttributesScope
- org.springframework.web.context.request.RequestScope
- All Implemented Interfaces:
Scope
public class RequestScope extends AbstractRequestAttributesScope
Request-backedScopeimplementation.Relies on a thread-bound
RequestAttributesinstance, which can be exported throughRequestContextListener,RequestContextFilterorDispatcherServlet.This
Scopewill also work for Portlet environments, through an alternateRequestAttributesimplementation (as exposed out-of-the-box by Spring'sDispatcherPortlet.- Since:
- 2.0
- Author:
- Rod Johnson, Juergen Hoeller, Rob Harrop
- See Also:
RequestContextHolder.currentRequestAttributes(),RequestAttributes.SCOPE_REQUEST,RequestContextListener,RequestContextFilter,DispatcherServlet,DispatcherPortlet
Constructor Summary
Constructors Constructor Description RequestScope()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetConversationId()There is no conversation id concept for a request, so this method returnsnull.protected intgetScope()Template method that determines the actual target scope.Methods inherited from class org.springframework.web.context.request.AbstractRequestAttributesScope
get, registerDestructionCallback, remove, resolveContextualObject
Constructor Detail
RequestScope
public RequestScope()
Method Detail
getScope
protected int getScope()
Description copied from class:AbstractRequestAttributesScopeTemplate method that determines the actual target scope.- Specified by:
getScopein classAbstractRequestAttributesScope- Returns:
- the target scope, in the form of an appropriate
RequestAttributesconstant - See Also:
RequestAttributes.SCOPE_REQUEST,RequestAttributes.SCOPE_SESSION,RequestAttributes.SCOPE_GLOBAL_SESSION
getConversationId
public String getConversationId()
There is no conversation id concept for a request, so this method returnsnull.- Returns:
- the conversation ID, or
nullif there is no conversation ID for the current scope