|
Get a list of all sessions of an application: msg#00050java.enhydra.general
Hello! we use Enhydra 5 for a intranet project. I want to display a page with all currently connected users (=sessions) and tried the code below. The problem ist that in the method activeSessions() I get all sessionskeys but sm.getSession(key) returns only the calling session and null for every other. When I register my thread using Enhydra.register(), the result is the same. So any solution? ------------------------------------------------ private Vector activeSessions() { Vector sessions = new Vector(); try{ StandardSessionManager sm = (StandardSessionManager) Enhydra.getSessionManager(); Enumeration keys = sm.getSessionKeys(); while(keys.hasMoreElements()) { sessions.addElement(sm.getSession((String) keys.nextElement())); } } catch (Exception ex) { // log it } return sessions; } To get the session listing Enhydra.register(Thread.currentThread(), getComms().application); try{ sessions = activeSessions(); } finally { Enhydra.unRegister(Thread.currentThread()); } -- Dipl. Inform. Boris Klug, control IT GmbH, Germany
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Enhydra: Debugging Enhydra applications in NetBeans, Blasius Lofi Dewanto |
|---|---|
| Next by Date: | Re: Get a list of all sessions of an application, Terry Steichen |
| Previous by Thread: | Enhydra: Debugging Enhydra applications in NetBeans, Blasius Lofi Dewanto |
| Next by Thread: | Re: Get a list of all sessions of an application, Terry Steichen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |