> I would like to know how many active valid sessions
> currently running in the container, ie how many users
> are using the system at the snapshot. How can I
> approache it? Thanks

There's no direct way to get this number (i.e no method in ServletContext,
etc. that gives you that number directly).
However, you can add a HttpSessionListener to your app and let it change
(sessionCreated increments the number, sessionDestroyed decrements it) a
number saved as an attribute in the servlet context. To get to current
number just get that attribute from the context.

HTH!

-mw

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to