Top Description Methods
javax.servlet.http

public Interface HttpSessionListener

extends EventListener
Imports
java.util.EventListener

Interface for receiving notification events about HttpSession lifecycle changes.

In order to receive these notification events, the implementation class must be either declared in the deployment descriptor of the web application, annotated with javax.servlet.annotation.WebListener, or registered via one of the addListener methods defined on javax.servlet.ServletContext.

Implementations of this interface are invoked at their sessionCreated method in the order in which they have been declared, and at their sessionDestroyed method in reverse order.

Since
Servlet 2.3
See Also
HttpSessionEvent

Method Summary

Modifier and TypeMethod and Description
public default void
sessionCreated(HttpSessionEvent
the HttpSessionEvent containing the session
se
)

Receives notification that a session has been created.

public default void
sessionDestroyed(HttpSessionEvent
the HttpSessionEvent containing the session
se
)

Receives notification that a session is about to be invalidated.

Method Detail

sessionCreatedback to summary
public default void sessionCreated(HttpSessionEvent se)

Receives notification that a session has been created.

Implementation Specification

The default implementation takes no action.

Parameters
se:HttpSessionEvent

the HttpSessionEvent containing the session

sessionDestroyedback to summary
public default void sessionDestroyed(HttpSessionEvent se)

Receives notification that a session is about to be invalidated.

Implementation Specification

The default implementation takes no action.

Parameters
se:HttpSessionEvent

the HttpSessionEvent containing the session