This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Is there a way to know how many HttpSession Objects in the container? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Is there a way to know how many HttpSession Objects in the container?" Watch "Is there a way to know how many HttpSession Objects in the container?" New topic
Author

Is there a way to know how many HttpSession Objects in the container?

Lipman Li
Ranch Hand

Joined: May 02, 2002
Posts: 122
the information will be useful, if you want to know how many users
actively
are using your system currently.
Santosh Maskar
Ranch Hand

Joined: Jul 02, 2003
Posts: 226
hi
by using the getCreationTime()
it return the time when session is created by using this u can track the number of user currently logging in
Lipman Li
Ranch Hand

Joined: May 02, 2002
Posts: 122
we know that the HttpSession.getCreationTime() could give some hints, but how could you get the reference to this HttpSession Object in the first place?
I'm thinking that there must be something with container, which could give a collection of those session object. maybe it is container specific feature.
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5371
there was one method which could give you all active session but now it is deprecated.


"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5371
I think you have to implement one of the listeners for session to keep active session count.
Lipman Li
Ranch Hand

Joined: May 02, 2002
Posts: 122
probably I can do something withHttpSessionBindingListener to track the number of Active session
manually
. but I still strongly think that such information shall be provided by container.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is there a way to know how many HttpSession Objects in the container?
 
Similar Threads
PreparedStatement (displaying records)
to know the no of client requesting
OODBMS vs RDBMS
SCWCD number of questions
Rules Round up Game