Hello,
You need a static (singleton) counter somewhere that is incremented when
a user is authenticated and decremented when the session is destroyed.
One way would be to have a static AtomicLong in your WebApplication
subclass; or a spring bean; or via persistence for an authenticated
users table.
Your home page label would have a model that does a:
new AbstractReadOnlyModel() {
public Object getObject() {
YourApplication ya = (YourApplication)getApplication();
// the simple AtomicLong case
return "Logged on users:" + ya.getLoggedInUsers();
}
};
This would keep the label accurate (at the time of each users most
recent page render).
Mike
i wanted to have the number of login users to be shown on all user's screen.
This means, once a new user login, the number of login users shows on other
active
user's screen will be updated.
Let say there are 2 sessions is currently log in into my application.
session.getSessionId() == [bm1pgdr1y9hf]
session.getSessionId() == [198y9m0etdvpj]
When the first user [bm1pgdr1y9hf] login, i want to update the page to show
'Logged on users:1'
in [bm1pgdr1y9hf] 's homepage.
When the second user [198y9m0etdvpj] login, i want to update the page to
show 'Logged on users:2'
in both [bm1pgdr1y9hf] and [198y9m0etdvpj] 's homepage.
How can I update [bm1pgdr1y9hf] 's homepage after the second user
[198y9m0etdvpj] login?
Thanks alot again for your replies
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org