tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominik Enkelmann" <dominik.enkelm...@next.it>
Subject R: how to know when an http session is destroyed
Date Thu, 13 Apr 2000 15:58:06 GMT
Henri,

i just started to look at this feature, try to add something like the code
below to your bean.
In the valueUnbound method you can do any cleanup you need, like
disconnecting from a db.

Dominik


import javax.servlet.*;
import javax.servlet.http.*;

public class WorkerBean
	implements HttpSessionBindingListener


	...

	// HttpSessionBindingListener interface methods
	// we implement this to clean up an eventually started jdbc transaction
 	public void valueBound(HttpSessionBindingEvent event) {
		System.err.println("Protocol: i am bound to " +event.getName());
	}

	// ???
 	public void valueUnbound(HttpSessionBindingEvent event)  {
		System.err.println("Protocol: i am freed from " +event.getName());
	}
}
-----Messaggio originale-----
Da: GOMEZ Henri [mailto:hgomez@slib.fr]
Inviato: giovedì 13 aprile 2000 16.19
A: tomcat-user@jakarta.apache.org
Oggetto: how to know when an http session is destroyed


Hi,

Is there a way to know when the servlet engine destroy an http session
(when it fall in timeout for example)

Thanks

-
Henri Gomez                  ___[_]____
EMAIL : hgomez@slib.fr         (. .)
PGP KEY : 697ECEDD     ...oOOo..(_)..oOOo...
PGP Fingerprint : 9DF81EA8ED532F39DC9B904A364F80E6

--------------------------------------------------------------------------
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org



Mime
View raw message