How to know the how many people are using the appllication..

hi friends...i have web application its login based... my problem is i have to show the all user names using application currently in that page.. so how can i do that?any one tell me...thankx in advance...
[240 byte] By [ravi-kumar-123a] at [2007-11-27 9:06:25]
# 1
When I did a project using Oracle as back end, I have done this. I forgot the table name, but there is an Oracle table which will tell you, who are all loggedin. Based on that you can display the users.
skp71a at 2007-7-12 21:41:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

> hi friends...

>

> i have web application its login based... my problem

> is i have to show the all user names using

> application currently in that page.. so how can i do

> that?

> any one tell me...

>

> thankx in advance...

here's an article that may help--just add a Map and throw each successful login into the Map..use the Map size for a count:

http://www.stardeveloper.com/articles/display.html?article=2001112001

BlackTroublea at 2007-7-12 21:41:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Perfect case for using filters.
PatrickWanga at 2007-7-12 21:41:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Hi BlackTrouble....Thanks a lotttttttttttt.... its working fine...dont mine one more doubt.... my web application is login based...can capture user names currently using the application....thanks..
ravi-kumar-123a at 2007-7-12 21:41:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

It's fairly straightforward.

Extend your login and logout logic with the following basic example:private static Set<User> loggedInUsers;

public void login(User user) {

loggedInUsers.add(user);

}

public void logout(User user) {

loggedInUsers.remove(user);

}

or use Set<String> for user names only or so.

Message was edited by:

BalusC

BalusCa at 2007-7-12 21:41:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...