Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to write a application to display online members with jsp?

 
bill wong
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to write a application to display online members with jsp?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34839
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bill,
Welcome to JavaRanch!

Where are your online members stored? If they are in a database, you can use JDBC.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by bill wong:
how to write a application to display online members with jsp?


Bill,
your question is too ambiguous.
[ December 05, 2004: Message edited by: Adeel Ansari ]
 
bill wong
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my db
id
login
password
level
money
country
hero
strength
agility
intelligence
online
setup
location
ecperience
hp
mp
damage
armor

when user online, 'online' will be set to '1'
when user press offline button, 'online' will be set to '0'
if user did not press offline button and terminal internet explorer,
'online' will set '1' forever
I want to know server how to know user terminal ie so that 'online' can be set to '0'.
thanks~
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
see HttpSessionListener it will guide you through.
 
Paul Bourdeaux
Ranch Hand
Posts: 783
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use HttpSessionListener to listen for sessions being created or removed. When one is, query the database for all users with a "1" in the online field. Update the data to a hashmap that is stored in a ServletContext attribute (so it is accessable by the entire web app).
 
Jay King
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the requirement is show "online users", the logged in users is only half of the problem. You need to display how many "Guests" are online as well.

- Jay
JavaRSS.com, Java News, Java Articles and Java Blogs, Just one Bookmark.
 
Jay King
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the requirement is show "online users", the logged in users is only half of the problem. You need to display how many "Guests" are online as well.

- Jay
JavaRSS.com, Java News, Java Articles and Java Blogs, Just one Bookmark.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic