Hi Ian,

I think your bean would need to implement the HttpSessionBindingListener
interface. This interface has two methods: valueBound() is called with the
bean is added to a session, and valueUnbound() is the opposite
(valueUnbound() is also called when the session is invalidated). An
HttpSessionBindingEvent object is sent to both methods to identify the
session and the name of your bean instance in the session.

Check out HttpSessionBindingListener and HttpSessionBindingEvent in the
Servlet API.

Scott Evans
SI&I Training Development




-----Original Message-----
From: Ian Graham [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 24, 2000 2:01 PM
To: [EMAIL PROTECTED]
Subject: Session timeout and having to make a database call


Hi Everyone,

I have looked through all the emails that are raging at the moment about
session timeouts. I have a similar problem but when the session times out I
have to remove his entry from a database table.

Basically the scenario is this:

The user logs into the system and an entry is added to a table (used to
ensure that no one person can login twice)
He/she makes use of the system and then he could use the logout button which
would clear the table, or the session out timeout and then he try's to use
the system again, but he is returned back to the login screen (and his entry
in the table is removed). What I can't work out how to do is if the user
just closes his window or types in another URL etc how can I trap that and
remove his entry from the table.

Is there an function that can be written in the sessioned bean that when the
session times out that function is ran and clears up after itself???

The only other solution I can think of is to date/time stamp the entry in
the login table and everytime an operation is carried out this is updated,
and then in the background have a routine which is clearing out this
table....

Any help would be greatly appreciated,
Ian

===========================================================================
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