It's not a secret anymore!
The moose likes Servlets and the fly likes jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "jsp" Watch "jsp" New topic


lrk naidu

Joined: Feb 04, 2005
Posts: 6
hi all,
if i want to know the of users using the site ,
ex:when we login to yahoo it should be display the no of users using these site is like 10000 and when we logout it should display the no of users are
how to write the code?
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Put the count in application context and increment it by 1 on every login. Use HttpSessionListener to detect logout.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

I'm confused, your thread title is "JSP" but you are asking how to get the number of current users.

If this is strictly a JSP question, we have a JSP forum for JSP questions, whereas this forum is for Servlets questions.

If this is about number of users, then change your thread topic to match it soo when we see a list of the threads in this forum we know what this thread is going to be about.



Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: jsp
It's not a secret anymore!