create a class implementing this interface. you implement 2 of its methods - 1 is called when any session is created, and 1 when any is destroyed.
so at any moment you can get #created minus #destroyed = count of active
i guess, you might need to know the count, so in that class, you can, for example write the count to a file, or to Sysout.
add this class to the web.xml. and have the server know of this addition. and there you go...
Jesus Angeles
Ranch Hand
Joined: Feb 26, 2005
Posts: 2036
posted
0
also, the first time the listener's sessionCreated method is called, put the instance of the listener to the servlet context as an attribute, so every body in the context can use it
Mathew Sam
Ranch Hand
Joined: Dec 19, 2001
Posts: 124
posted
0
Actually the requirement is to invalidate all the active httpsession when the application is shutdown. I want to get the refernces of all active httpsession to explicity invalidate when the application is stopped.
Mathew Sam
Ranch Hand
Joined: Dec 19, 2001
Posts: 124
posted
0
Basically looking for the functinality of HttpSessionContext.getIds() which is deprecated.
David Ulicny
Ranch Hand
Joined: Aug 04, 2004
Posts: 724
posted
0
I suppose there is no such public API for this. It would break the security.