Hi!

I´m looking for the same in this moment and I think that I have found
something but I´m not very sure that it´s correct.

It exist an interface called HttpSessionBindingListener. If you make a
JavaBean, that implements this interface, you will be able to overload two
methods valueBound() and valueUnbound(). valueBound() method is executed
when an instance of this JavaBean is inserted in Session, and valueUnbound()
when the object is removed from session.

If you leave an instance of this JavaBean in the session, then the
valueUnbound()  method will be executed when the session will be destroyed.

Like I´ve said before, I´ve not tested this yet, and I´m not very sure that
it runs. If exists other way to do this, I'd like to know it.

I wait it will be usefull.

Regards

David Mellado
[EMAIL PROTECTED]

-----Mensaje original-----
De: Unnikrishnan.M.K <[EMAIL PROTECTED]>
Para: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Fecha: martes, 20 de febrero de 2001 10:00
Asunto: Shopping cart cleanup


>Hi,
>  How can we clear a shopping cart(in JSP using HttpSession) when the
client
>closes a browser window?
>Regards
>Unni
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to