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...
Maybe he went home and went to bed. And took this tiny ad with him: