tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: How to figure out the currently existing sessions?
Date Tue, 17 Aug 2004 19:57:36 GMT

One portable way is to write an HttpSessionListener.  Register it in
web.xml and have it keep a Map (or another data structure, depending on
your needs) of HttpSessions.  It would update the list when a session is
created and destroyed.

Another way involves more Tomcat-specific code, and is therefore less
portable and less desirable.  You'd navigate the Tomcat container
hierarchy down to the Manager element of your Host, and use its methods
like findSessions to do whatever you need.

The Manager webapp (not to be confused with the session Manager above)
also provides some very elementary session statistics, such as the
number of active sessions for every webapp.

Yoav Shapira
Millennium Research Informatics

>-----Original Message-----
>From: Zsolt Koppany []
>Sent: Tuesday, August 17, 2004 3:55 PM
>To: Tomcat Users List
>Subject: How to figure out the currently existing sessions?
>how can I figure out the currently existing sessions?
>To unsubscribe, e-mail:
>For additional commands, e-mail:

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

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

View raw message