|
spring-web | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.web.context.request.AbstractRequestAttributesScope
org.springframework.web.context.request.SessionScope
public class SessionScope
Session-backed Scope
implementation.
Relies on a thread-bound RequestAttributes
instance, which
can be exported through RequestContextListener
,
RequestContextFilter
or
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
org.springframework.web.portlet.DispatcherPortlet
.
RequestContextHolder.currentRequestAttributes()
,
RequestAttributes.SCOPE_SESSION
,
RequestAttributes.SCOPE_GLOBAL_SESSION
,
RequestContextListener
,
RequestContextFilter
,
org.springframework.web.servlet.DispatcherServlet
,
org.springframework.web.portlet.DispatcherPortlet
Constructor Summary | |
---|---|
SessionScope()
Create a new SessionScope, storing attributes in a locally isolated session (or default session, if there is no distinction between a global session and a component-specific session). |
|
SessionScope(boolean globalSession)
Create a new SessionScope, specifying whether to store attributes in the global session, provided that such a distinction is available. |
Method Summary | |
---|---|
java.lang.Object |
get(java.lang.String name,
org.springframework.beans.factory.ObjectFactory objectFactory)
|
java.lang.String |
getConversationId()
|
protected int |
getScope()
Template method that determines the actual target scope. |
java.lang.Object |
remove(java.lang.String name)
|
Methods inherited from class org.springframework.web.context.request.AbstractRequestAttributesScope |
---|
registerDestructionCallback, resolveContextualObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SessionScope()
public SessionScope(boolean globalSession)
This distinction is important for Portlet environments, where there are two notions of a session: "portlet scope" and "application scope". If this flag is on, objects will be put into the "application scope" session; else they will end up in the "portlet scope" session (the typical default).
In a Servlet environment, this flag is effectively ignored.
globalSession
- true
in case of the global session as target;
false
in case of a component-specific session as targetorg.springframework.web.portlet.context.PortletRequestAttributes
,
ServletRequestAttributes
Method Detail |
---|
protected int getScope()
AbstractRequestAttributesScope
getScope
in class AbstractRequestAttributesScope
RequestAttributes
constantRequestAttributes.SCOPE_REQUEST
,
RequestAttributes.SCOPE_SESSION
,
RequestAttributes.SCOPE_GLOBAL_SESSION
public java.lang.String getConversationId()
public java.lang.Object get(java.lang.String name, org.springframework.beans.factory.ObjectFactory objectFactory)
get
in interface org.springframework.beans.factory.config.Scope
get
in class AbstractRequestAttributesScope
public java.lang.Object remove(java.lang.String name)
remove
in interface org.springframework.beans.factory.config.Scope
remove
in class AbstractRequestAttributesScope
|
spring-web | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |