> > > Can I catch the event when a session is created from tomcat?
> > 
> > 
> > Yes, take a look at 
> javax.servlet.HttpSessionBindingListener in servlet API.
> > This has been covered on this group before please look at 
> the list archives.
> > 
> 
> Actually, this doesn't accurately answer the original question.
> 
> You can indeed use HttpSessionBindingListener to detect when 
> a particular
> object is *added* to a session.  That is not the same as when 
> the session
> is *created*.  Note that it explicitly requires the application to
> participate (by adding a specific session attribute).
> 
> In a servlet 2.3 environment (i.e. Tomcat 4), there is a new feature
> called application event listeners.  In particular, there are defined
> listeners for "session created" and "session destroyed" that 
> are called at
> those precise times, not just when a particular object is added and
> removed.

That is what I mean.  Binding Listeners and the Tomcat 4 implementation
of the listeners have been discussed before and can be referred to in
more detail in the archives.  I believe someone mentioned doing this
with a SessionInterceptor and the binding listener a while back but
I'm not sure.



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

Reply via email to