java.lang.Object | ||
↳ | org.springframework.web.context.request.AbstractRequestAttributesScope | |
↳ | org.springframework.web.context.request.SessionScope |
Session-backed Scope
implementation.
Relies on a thread-bound RequestAttributes
instance, which
can be exported through RequestContextListener
,
RequestContextFilter
or
DispatcherServlet
.
This Scope
will also work for Portlet environments,
through an alternate RequestAttributes
implementation
(as exposed out-of-the-box by Spring's
DispatcherPortlet
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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).
| |||||||||||
Create a new SessionScope, specifying whether to store attributes
in the global session, provided that such a distinction is available.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Remove the object with the given
name from the underlying scope. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Template method that determines the actual target scope.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.web.context.request.AbstractRequestAttributesScope
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.beans.factory.config.Scope
|
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).
Create a new SessionScope, specifying whether to store attributes in the global session, provided that such a distinction is available.
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 target |
---|
Remove the object with the given name
from the underlying scope.
Returns null
if no object was found; otherwise
returns the removed Object
.
Note that an implementation should also remove a registered destruction callback for the specified object, if any. It does, however, not need to execute a registered destruction callback in this case, since the object will be destroyed by the caller (if appropriate).
Note: This is an optional operation. Implementations may throw
UnsupportedOperationException
if they do not support explicitly
removing an object.
name | the name of the object to remove |
---|
null
if no object was presentTemplate method that determines the actual target scope.
RequestAttributes
constant