Name

HttpSessionBindingListener

Synopsis

Interface Name: javax.servlet.http.HttpSessionBindingListener

Superinterface: java.util.EventListener

Immediate Subinterfaces: None

Implemented By: None

Availability: New as of the Servlet API 2.0; found in JSDK 2.0, JWS 1.1

Description

An object that implements HttpSessionBindingListener is notified via calls to valueBound() and valueUnbound() when it is bound to or unbound from an HttpSession. Among other things, this interface allows orderly cleanup session-specific resources, such as database connections.

Interface Declaration

public interface HttpSessionBindingListener extends java.util.EventListener {
  // Methods
  public abstract void valueBound(HttpSessionBindingEvent event);
  public abstract void valueUnbound(HttpSessionBindingEvent event);
}

Methods

valueBound()

public abstract void valueBound(HttpSessionBindingEvent event)
Description

Called when the listener is bound to a session.

valueUnbound()

public abstract void valueUnbound(HttpSessionBindingEvent event)
Description

Called when the listener is unbound from a session (including at session destruction).

Get Java Servlet Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.