Re: List of logged users

2006-05-04 Thread Bryan Lewis
f you only need to get the user's name (and don't mind one >private string), Tapestry stores it in the session: > > String username = session.getAttribute("tapestry.engine.username"); > > > > > > >James Carman wrote: > > > >&g

Re: List of logged users

2006-05-04 Thread Bryan Lewis
r logged in user list (make it a map) by the session >id? Wouldn't that work? > >-Original Message- >From: Oscar Picasso [mailto:[EMAIL PROTECTED] >Sent: Thursday, May 04, 2006 12:54 PM >To: Tapestry users >Subject: Re: List of logged users > >I have tried to imple

Re: List of logged users

2006-05-04 Thread Adam Zimowski
4/06, James Carman <[EMAIL PROTECTED]> wrote: > Perhaps you can key your logged in user list (make it a map) by the session > id? Wouldn't that work? > > -Original Message- > From: Oscar Picasso [mailto:[EMAIL PROTECTED] > Sent: Thursday, May 04, 2006 12:54 PM >

Re: List of logged users

2006-05-04 Thread Mike Snare
Thursday, May 04, 2006 12:54 PM To: Tapestry users Subject: Re: List of logged users I have tried to implement the HttpSessionListerner solution. I have a slight problem. In the HttpSessionListener.destroy method I need to get a session scoped "user" state object. This "user" s

RE: List of logged users

2006-05-04 Thread James Carman
Perhaps you can key your logged in user list (make it a map) by the session id? Wouldn't that work? -Original Message- From: Oscar Picasso [mailto:[EMAIL PROTECTED] Sent: Thursday, May 04, 2006 12:54 PM To: Tapestry users Subject: Re: List of logged users I have tried to implemen

Re: List of logged users

2006-05-04 Thread Oscar Picasso
I have tried to implement the HttpSessionListerner solution. I have a slight problem. In the HttpSessionListener.destroy method I need to get a session scoped "user" state object. This "user" state object is then removed from the list of currently logged users. It works fine except I get an I

Re: List of logged users

2006-05-04 Thread Oscar Picasso
Very interesting approach. Thanks Mike Snare <[EMAIL PROTECTED]> wrote: The service implementation is a cover for the singleton. Imagine: /** * A simple HiveMind service */ public interface ISomeService { void doSomething(); } /** * The implementation of the hivemind service, delegates

Re: List of logged users

2006-05-04 Thread Mike Snare
The service implementation is a cover for the singleton. Imagine: /** * A simple HiveMind service */ public interface ISomeService { void doSomething(); } /** * The implementation of the hivemind service, delegates to the singleton. */ public class SomeServiceImpl implements ISomeService {

Re: List of logged users

2006-05-04 Thread Oscar Picasso
Original Message- > From: Martijn Hinten [mailto:[EMAIL PROTECTED] > Sent: Thu 5/4/2006 10:22 PM > To: Tapestry users > Subject: Re: List of logged users > > Implement a HttpSessionListener. This listener will be notified of all > sessions that are destroyed (it's sessi

RE: List of logged users

2006-05-04 Thread Haldane, Sam
That helps, thanks. How would you do it in Tapestry 3? Sam -Original Message- From: James Carman [mailto:[EMAIL PROTECTED] Sent: Thu 5/4/2006 10:40 PM To: 'Tapestry users' Subject: RE: List of logged users The HiveMind registry is located in the ServletContext. You can loo

RE: List of logged users

2006-05-04 Thread James Carman
ter if you have to). From there, you can lookup the ApplicationStateManager service and get to the ASO. -Original Message- From: Haldane, Sam [mailto:[EMAIL PROTECTED] Sent: Thursday, May 04, 2006 8:33 AM To: Tapestry users; Tapestry users Subject: RE: List of logged users How w

RE: List of logged users

2006-05-04 Thread James Carman
). From there, you can lookup the ApplicationStateManager service and get to the ASO. -Original Message- From: Haldane, Sam [mailto:[EMAIL PROTECTED] Sent: Thursday, May 04, 2006 8:33 AM To: Tapestry users; Tapestry users Subject: RE: List of logged users How would one access tapestry from

Re: List of logged users

2006-05-04 Thread Mike Snare
ss tapestry from a listener like this? For example, access a tapestry application state object which holds the list of users. Sam -Original Message- From: Martijn Hinten [mailto:[EMAIL PROTECTED] Sent: Thu 5/4/2006 10:22 PM To: Tapestry users Subject: Re: List of logged users

RE: List of logged users

2006-05-04 Thread Haldane, Sam
How would one access tapestry from a listener like this? For example, access a tapestry application state object which holds the list of users. Sam -Original Message- From: Martijn Hinten [mailto:[EMAIL PROTECTED] Sent: Thu 5/4/2006 10:22 PM To: Tapestry users Subject: Re: List of

Re: List of logged users

2006-05-04 Thread Martijn Hinten
Implement a HttpSessionListener. This listener will be notified of all sessions that are destroyed (it's sessionDestroyed() method will be called). In that method you can check which user is logged off en remove that user from the (applicationscope, I guess) list. See code sample below. Good

RE: List of logged users

2006-05-04 Thread James Carman
You can use a session listener for this: http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSessionListener .html You register it in your web.xml file. -Original Message- From: Oscar Picasso [mailto:[EMAIL PROTECTED] Sent: Thursday, May 04, 2006 8:15 AM To: Tapestry users S