Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 59192 invoked from network); 9 Nov 2001 17:01:36 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 9 Nov 2001 17:01:36 -0000 Received: (qmail 11977 invoked by uid 97); 9 Nov 2001 17:01:06 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 11951 invoked by uid 97); 9 Nov 2001 17:01:05 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 11938 invoked from network); 9 Nov 2001 17:01:04 -0000 Date: Fri, 9 Nov 2001 08:48:53 -0800 (PST) From: "Craig R. McClanahan" Sender: To: Tomcat Users List Subject: Re: Sessions In-Reply-To: <002b01c168f4$172f9db0$98672d0a@stg29> Message-ID: <20011109084708.A98004-100000@localhost> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: localhost 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Fri, 9 Nov 2001, Roland Carlsson wrote: > Date: Fri, 9 Nov 2001 08:56:50 +0100 > From: Roland Carlsson > Reply-To: Tomcat Users List > To: Tomcat Users List > Subject: Sessions > > Hi! > > I wanna se how many sessions I have on a host. But since the servlet > api doesn't allow me to do this kind of groupfunctions I wonder if > there is a "hack" I can do to get this information. Or is there > another way of doing this that perhaps is a little more transportable > then hackning a Tomcat-class? > In a Servlet 2.3 environment, you can accumulate this information by registering an HttpSessionListener that is called when sessions are created and destroyed. In the listener, you could keep your own HashMap of the session objects. In a Servlet 2.2 environment, the only practical way is to make sure that your application always stores an object in the session at login time, and the object's class implements HttpSessionBindingListener. You could do the same sort of tracking in the valueBound() and valueUnbound() methods of this listener. > Thanks in advance > Roland Carlsson > Craig -- To unsubscribe: For additional commands: Troubles with the list: