Get session id for making invalidate the session
I thing this is the simple questions . any body please answer the following question . I am new to java servlet .. I want to know who are all the active users in the server . other words is it possible to know how many users currently login in the server ..
Message was edited by:
sat_hiya
Message was edited by:
sat_hiya
[354 byte] By [
sat_hiyaa] at [2007-10-2 23:59:02]

> Use the HttpSessionActivationListener to catch when a
> session is created and invalidated.
I don't believe that this will have the desired effect.
From the JavaDocs
Objects that are bound to a session may listen to container events notifying them that sessions will be passivated and that session will be activated. A container that migrates session between VMs or persists sessions is required to notify all attributes bound to sessions implementing HttpSessionActivationListener.
This interface allows an object that is part of a session to listen to events relating to that session. Using this it would be possible to code a solution that maintains the count of the number of active users, but I believe that the better solution is to use HttpSessionListener
Implementations of this interface are notified of changes to the list of active sessions in a web application. To receive notification events, the implementation class must be configured in the deployment descriptor for the web application.