Skip to Main Content
Java Servlet Programming, 2nd Edition
book

Java Servlet Programming, 2nd Edition

by Jason Hunter, William Crawford
April 2001
Intermediate to advanced content levelIntermediate to advanced
780 pages
23h 48m
English
O'Reilly Media, Inc.
Content preview from Java Servlet Programming, 2nd Edition

Name

HttpSessionBindingListener

Synopsis

Interface Name: javax.servlet.http.HttpSessionBindingListener

Superinterface: java.util.EventListener

Immediate Subinterfaces: None

Implemented By: None

Availability: Servlet API 2.0 and later

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. Note that in a distributed environment the valueBound( ) call may be made inside a different JVM than the valueUnbound( ) call.

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).

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Servlet Programming

Java Servlet Programming

Jason Hunter

Publisher Resources

ISBN: 0596000405Supplemental ContentErrata Page