hi
The standard javax.servlet.http package provides the HttpSessionBindingListener interface and HttpSessionBindingEvent class to manage session-scoped resources. A
JSP page must appropriately manage resources acquired during its execution, such as
JDBC connection, statement, and result set objects. for example, acquire a database cursor when the bean is instantiated and close it when the HTTP session is terminated.
An object that implements the HttpSessionBindingListener interface can implement a valueBound() method and a valueUnbound() method, each of which takes an HttpSessionBindingEvent instance as input.
These methods are called by the servlet container--the valueBound() method when the object is stored in the session; the valueUnbound() method when the object is removed from the session or when the session times-out or becomes invalid.
Following is the sample code for JDBCQueryBean
web page