• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to judge whether the user is online?

 
Yashnoo lyo
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone:
I know the HttpSessionBindingListener can do this.I haven't use the HttpSessionBindingListener before.I find some information and my comprehension is create a new java servlet.I implement the HttpSessionBindingListener interface and define a variable "path".It is be used to record the path of the image("offline.jpg and online.jpg").I use the "session.getattribute("lyo")==null" in the valueBound method to judge whether the user login.The "session("lyo")" is the property after one user login.The path will be equals to "../src/online.jpg" if one user login successfully and otherwise the path will be "../src/offline.jpg".But where can I use the servlet?The session has a attribute "lyo" when one user login.Can I add another attribute to the user when he login?And the where can I use the variable path? Please help me.Thank you!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!