• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

knowing how many guests and registered users

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all.
there are some sites that tell you, when you visit their site, how many guests and registered users are visiting the site.
example:
when you visit the site, you find :
There are 200 guest online and 50 registered users online.
can you explain to me, how can I implement this mechanism.
 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a. Use a Java Bean to record this data

b. Load this java bean into application scope when application starts

c. Store the state of java bean into database or file. Here you need ContextListener

d. When there is a new access, change the state of java bean, and show "you are xxxx guests"
 
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Someone please correct this if I'm wrong, but I believe the simple answer is that you just know whether the person visiting your site is a registered user if you can find that out who they are from a cookie you store in their browser.
reply
    Bookmark Topic Watch Topic
  • New Topic