-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin,

MartinOShea wrote:
| I'm trying to find a way to detect the events caused when a user logs into
| or logs out of an application I'm working on.

There is no good way to do this in Tomcat.

In order to do something similar (we want to load user preferences from
the database after login), we created a Filter that checks every request
for a session containing a "user" object. If the user object is not
present, we perform the "login" (which is actually /after/ the
authentication and authorization), load whatever we want from the
database, etc., and then put the "user" object into the session. After
that, the Filter basically does nothing.

As for logout, you really only have one option: use a SessionListener to
observe sessionDestroyed events. If your users never explicitly log out
of your application, then you will only be notified when their sessions
time-out.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkiRzeMACgkQ9CaO5/Lv0PAKqwCgsEDoZVioBnq1yy2MsOqtH9Pc
DcMAn3lqm0G11gA+JGGdlfRkStkI/M8x
=tIGF
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: [email protected]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to