Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp

 
lrk naidu
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put the count in application context and increment it by 1 on every login. Use HttpSessionListener to detect logout.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic