You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michael Wentzel <Mi...@aswethink.com> on 2001/08/16 18:54:06 UTC

RE: Session of Tomcat.

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

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

RE: Session of Tomcat.

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 16 Aug 2001, Michael Wentzel wrote:

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

> ---
> Michael Wentzel

Craig McClanahan