//Define a listener like this:

class CustomBindingListener implements HttpSessionBindingListener {

  public CustomBindingListener() {
  }

    /** Called when bound to a new session. Creates and stores a database
connection.
     */
  public void valueBound(HttpSessionBindingEvent event) {
      System.out.println("BOUND as " + event.getName() + " from " +
event.getSession().getId());
  }

    /** Called when a session is invalidated. Closes the stored database
connection.
     */
  public void valueUnbound(HttpSessionBindingEvent event) {
      System.out.println("UNBOUND as " + event.getName() + " from " +
event.getSession().getId());

  }
}

//Use it like this:
HttpSession session;

session.putValue("bindings.listener", new CustomBindingListener());


At 05:00 PM 11/22/99 -0800, Sandeep Yarramreddy wrote:
>hi,
>has anyone used HttpSessionBindingListener class. I do not see any
>examples of
>its usage in the tutorial on suns web site. can some one please show an
>example of how to use it.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to