tomcat-dev mailing list archives

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

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.

Thanks


John Baker

-- 
John Baker, BSc CS.
Java Developer, TEAM EAA.. http://www.teamenergy.com
Views expressed in this mail are my own.

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message