my dog learned polymorphism
The moose likes Tomcat and the fly likes Users in a server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Users in a server" Watch "Users in a server" New topic

Users in a server

gokulanand narayanan

Joined: Feb 16, 2006
Posts: 23

I want to know about the total number of users using a particular application in a particular server .

Thanks in advance.
Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
I am not sure about Tomcat specific tools. But I'd do it manually in my application. Use a HttpSessionListener to register the sessions created into the servlet context. Now we could write an admin servlet to retreive the registered sessions from the servlet context which tell us many things including no. of current users.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
The Tomcat Manager application can tell you how many current sessions a given web application has. I use it all the time for a quick glance at the state of the server.
Naturally this is only the count of sessions that have not expired so it is a maximum, not the number of active users. In order to use the Manager you have to configure a user with permission to see it - the default Tomcat installation has an extensive discussion.
I agree. Here's the link:
subject: Users in a server
jQuery in Action, 3rd edition