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 99999 how to write the code?
Adeel Ansari
Ranch Hand
Joined: Aug 15, 2004
Posts: 2874
posted
0
Put the count in application context and increment it by 1 on every login. Use HttpSessionListener to detect logout.
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.