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:[EMAIL PROTECTED] > Sent: Tuesday, August 12, 2003 10:47 AM > To: Tomcat Users List > Subject: Re: HttpSessionListener: Negative session count > > > Is it correct that I don't have to use > <jsp:useBean id="sessionCounter" class="SessionCounter" > scope="session" /> > and set the scope to "session"? > > Because now I don't use "useBean". Should I? > > > private static int activeSessions = 0; > > > > public void sessionCreated(HttpSessionEvent event) { > > activeSessions++; > > } > > > > public void sessionDestroyed(HttpSessionEvent event) { > > activeSessions--; > > } > > > > public static int getActiveSessions() { > > return activeSessions; > > } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
