If your web app was session-enabled, and your sessions were not non-expiring, I suppose you could create a HttpSessionListener to keep track of the total number of valid sessions at any given time.
Right... HTTP does NOT establish persistent connections, so the question "How many users are currently connected?" can have more than a couple interpretations...
Doe, a deer, a female deer. Ray, a pockeful of sun. Me, a name, I call my tiny ad ...