Specifies that a bean is session scoped.
While SessionScoped must be associated with the built-in session context required by the specification,
third-party extensions are
allowed to also associate it with their own context. Behavior described below is only related to the built-in session context.
The session scope is active:
service() method of any servlet in the web application,
HttpSessionListener, AsyncListener or
ServletRequestListener.The session context is shared between all servlet requests that occur in the same HTTP session.
The session context is destroyed:
HttpSessionListeners have been called, orinvalidate() was called, after all filters and ServletRequestListeners have been
called.
An event with qualifier @Initialized(SessionScoped.class) is fired when the session context is initialized and an
event
with qualifier @Destroyed(SessionScoped.class) when the session context is destroyed. The event payload is
the HttpSession
CDI Lite implementations are not required to provide support for the session scope.
| Modifier and Type | Class and Description |
|---|---|
| public static class | SessionScoped.Literal
Supports inline instantiation of the |
SessionScoped annotation.
| Modifier and Type | Field and Description |
|---|---|
| public static final SessionScoped. | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| INSTANCE | back to summary |
|---|---|
| public static final SessionScoped. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides jakarta. | |
| Literal | back to summary |
|---|---|
| public Literal() | |