Re: How to get a list of the connected users ?

2007-09-12 Thread landry soules
Thanks a lot for your answers, guys.
I will try the 2 approches.
Cheers.

Landry

2007/9/12, Matthijs Wensveen [EMAIL PROTECTED]:

 landry soules wrote:
  Hello,
 
  I have to display a list of the connected users in a page of my app. I
  know it sounds definitely dumb, but i don't know how to achieve this...
  Users login to my site (i extended AuthenticatedWebApplication), and
  then i update a isConnected flag in users table.
  Thus i display the connected users in a list view, retrieved by the
  isConnected flag.
  It implies of course that users will use a logoff button when they
  leave, which i don't believe they will do...
  I'm aware it's not a Wicket related problem, but a more generally web
  apps problem, but what is the best solution to deal with this ?
  Thanks for your answers.
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 If you don't want to tread on the lower-level servlet API, maybe you
 could do something with WebApplication.sessionDestroyed or
 ISessionStore.unbind. Although I'm not exactly sure when they are called
 (just browsing javadoc, that's all).

 Matthijs

 --
 Matthijs Wensveen
 Func. Internet Integration
 W http://www.func.nl
 T +31 20 423
 F +31 20 4223500


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: How to get a list of the connected users ?

2007-09-11 Thread Carlos Pita
Maybe you can write a session listener to intercept session
destruction (give a look at servlet api, in particular
HttpSessionListener). For sessions that do have an associated (logged
in) user you can set the isConnected flag to false then.

I wouldn't recommend keeping these flags in a persistent store anyway.
A session manager that keeps an in-memory transient set of logged in
users feels better to me. The users themselves need not to be kept all
the time in memory, of course, that would swallow up resources. This
way, if your application hangs up your currently logged in users state
will disappear together with your sessions.

Regards,
Carlos

On 9/11/07, landry soules [EMAIL PROTECTED] wrote:
 Hello,

 I have to display a list of the connected users in a page of my app. I
 know it sounds definitely dumb, but i don't know how to achieve this...
 Users login to my site (i extended AuthenticatedWebApplication), and
 then i update a isConnected flag in users table.
 Thus i display the connected users in a list view, retrieved by the
 isConnected flag.
 It implies of course that users will use a logoff button when they
 leave, which i don't believe they will do...
 I'm aware it's not a Wicket related problem, but a more generally web
 apps problem, but what is the best solution to deal with this ?
 Thanks for your answers.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to get a list of the connected users ?

2007-09-11 Thread John Krasnay
On Tue, Sep 11, 2007 at 11:24:38PM +0200, landry soules wrote:
 Hello,
 
 I have to display a list of the connected users in a page of my app. I 
 know it sounds definitely dumb, but i don't know how to achieve this...
 Users login to my site (i extended AuthenticatedWebApplication), and 
 then i update a isConnected flag in users table.
 Thus i display the connected users in a list view, retrieved by the 
 isConnected flag.
 It implies of course that users will use a logoff button when they 
 leave, which i don't believe they will do...

Implement an HttpSessionListener that clears the flag when the session
is destroyed, and register it in your web.xml. This will handle both the
case when they press the Logout button and when the session expires due
to inactivity.

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpSessionListener.html

jk

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to get a list of the connected users ?

2007-09-11 Thread Matthijs Wensveen

landry soules wrote:

Hello,

I have to display a list of the connected users in a page of my app. I 
know it sounds definitely dumb, but i don't know how to achieve this...
Users login to my site (i extended AuthenticatedWebApplication), and 
then i update a isConnected flag in users table.
Thus i display the connected users in a list view, retrieved by the 
isConnected flag.
It implies of course that users will use a logoff button when they 
leave, which i don't believe they will do...
I'm aware it's not a Wicket related problem, but a more generally web 
apps problem, but what is the best solution to deal with this ?

Thanks for your answers.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

If you don't want to tread on the lower-level servlet API, maybe you 
could do something with WebApplication.sessionDestroyed or 
ISessionStore.unbind. Although I'm not exactly sure when they are called 
(just browsing javadoc, that's all).


Matthijs

--
Matthijs Wensveen
Func. Internet Integration
W http://www.func.nl
T +31 20 423
F +31 20 4223500 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]