Originally posted by Tanveer Rameez:
I used HttpSessionContext.getSessionContext(); and from I obtain the enumeration of session IDs. but the method is deprecated.
Kindly let me know of nay alternative to get the list of sessions. I need the solution fast.
Hi, Tanveer,
I've encounterd a similar problem and have not solved it yet, but I think I just found the solution on the webpage of
More Servlets and JavaServer Pages. Go to
Chapter 10 and locate the sourcecode for SessionCounter.java.
This class is an exampe for a Session Listener (available since Servlet 2.3) which offers the following 2 methods:
public void sessionCreated(HttpSessionEvent event)
public void sessionDestroyed(HttpSessionEvent event)
Those can be used to get some Information about the sessions. Like described in this example you can save the relevant information in the servlet context and make it available to the servlet.
Hope it helps, I will try it out tonight...
Hartmut
[ September 12, 2002: Message edited by: Hartmut Ludwig ]