aspose file tools*
The moose likes Servlets and the fly likes knowing how many guests and registered users Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "knowing how many guests and registered users" Watch "knowing how many guests and registered users" New topic
Author

knowing how many guests and registered users

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

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.
danny liu
Ranch Hand

Joined: Jan 22, 2004
Posts: 185
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"
Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: knowing how many guests and registered users
 
Similar Threads
Number of online users
How many users are logged in?
Tips for Europe Trip
how to write a application to display online members with jsp?
users