tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Baker <>
Subject HttpSessionListener
Date Mon, 07 Oct 2002 09:59:01 GMT

I'm trying to write a bean so when sessions are closed, database connections 
and other resources are released. I realise when the sessionDestroyed method 
is called on HttpSessionListener the session is already invalidated (I would 
like to know why such a design decision was made there, it seems wrong). 
Anyway, as I need to be able to map stuff to a session I'm trying to write a 
listener where I can say "For this newly created session, hold on to this 
object". So when the session is destroyed, the object can be retrieved and 
methods called upon it (such as close db connections).

My question. How do I get to the HttpSessionListener from the application 
itself? I realise I have to define the listener in the web.xml, but I'd be 
quite shocked if this could not be done another way.


John Baker

John Baker, BSc CS.
Java Developer, TEAM EAA..
Views expressed in this mail are my own.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message