• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Retrieveing all active sessions  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone.

I was just wondering if it is possible to retrieve a list of all active sessions in a servlet container.

Could anyone please point me to an article so that I may learn how this could be done.

hank you.
 
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We used to have the SessionContext object with a getIds and getSession(id) methods but those have been deprecated (for security reasons) for a long time.
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSessionContext.html#getIds()

With listeners, you can implement your own solution for storing references to sessions in a context scope object and then read from that with a Servlet.

I have a demo app that does this.
http://simple.souther.us/not-so-simple.html

Look for SessionMonitor.
 
Nicolaos Kormara
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have just started to look at the mechanism of SessionListeners with your example. I feel it will be quite useful.

Thank you very much for your response and help
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!