Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 70352 invoked from network); 12 Aug 2003 08:54:14 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 12 Aug 2003 08:54:14 -0000 Received: (qmail 29116 invoked by uid 97); 12 Aug 2003 08:57:07 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@nagoya.betaversion.org Received: (qmail 29109 invoked from network); 12 Aug 2003 08:57:07 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 12 Aug 2003 08:57:07 -0000 Received: (qmail 68945 invoked by uid 500); 12 Aug 2003 08:53:57 -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 68932 invoked from network); 12 Aug 2003 08:53:56 -0000 Received: from services01.hh02.uptime.de (HELO mail01.hh02.uptime.de) (62.67.60.3) by daedalus.apache.org with SMTP; 12 Aug 2003 08:53:56 -0000 Received: (qmail 13069 invoked from network); 12 Aug 2003 08:54:09 -0000 Received: from unknown (HELO server01.hh.uptime.de) (postmaster@uptime-isc.de@212.202.153.225) by services01.hh02.uptime.de with SMTP; 12 Aug 2003 08:54:09 -0000 Subject: RE: HttpSessionListener: Negative session count MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Tue, 12 Aug 2003 10:54:08 +0200 Message-ID: content-class: urn:content-classes:message X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: HttpSessionListener: Negative session count Thread-Index: AcNgrebtg0KgmAp4TPiqe+8T9T3TsQAAKAxQ From: "Ralph Einfeldt" To: "Tomcat Users List" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N You don't need the useBean. A bean with session scope doesn't make sense at all, if you want to access the methods through an object you can make the object application global. Or you can make sessionCreated/sessionDestroyed static and just call them through the class. > -----Original Message----- > From: Christian Hauser [mailto:c.hauser@active.ch] > Sent: Tuesday, August 12, 2003 10:47 AM > To: Tomcat Users List > Subject: Re: HttpSessionListener: Negative session count >=20 >=20 > Is it correct that I don't have to use > scope=3D"session" /> > and set the scope to "session"? >=20 > Because now I don't use "useBean". Should I? >=20 > > private static int activeSessions =3D 0; > >=20 > > public void sessionCreated(HttpSessionEvent event) { > > activeSessions++; > > } > >=20 > > public void sessionDestroyed(HttpSessionEvent event) { > > activeSessions--; > > } > >=20 > > public static int getActiveSessions() { > > return activeSessions; > > } --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org