Re: Counting active sessions if server restarts very often

2003-09-04 Thread Christian Hauser
Shapira, Yoav wrote: Howdy, Is there an other way to implement this? Maybe by saving the variable activeSessions to a session (which is restored when the server has restarted)? This is not a bad idea, and might be the easiest way. A DB write on shutdown/read on startup is also an option. To

Re: Counting active sessions if server restarts very often

2003-09-04 Thread Christian Hauser
the count. This should eliminate the need to store anything in the session. Hope this helps Andy -Original Message- From: Christian Hauser [mailto:[EMAIL PROTECTED] Sent: 04 September 2003 10:01 To: Tomcat Users List Subject: Re: Counting active sessions if server restarts very often

Counting active sessions if server restarts very often

2003-09-03 Thread Christian Hauser
Hello list I implemented a session counter to count all active sessions. Now I have the problem that because the server is being restarted very often, my static variable activeSessions is always set to 0. Is there an other way to implement this? Maybe by saving the variable activeSessions to

Re: HttpSessionListener: Negative session count

2003-08-14 Thread Christian Hauser
Thank you Ralph So I should use the following: public void sessionCreated(HttpSessionEvent event) { synchronized (this) { activeSessions++; } } public void sessionDestroyed(HttpSessionEvent event) { synchronized (this) { if (activeSessions 0) {

Re: HttpSessionListener: Negative session count

2003-08-14 Thread Christian Hauser
I have a further question: 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? Thank you in advance, Christian Christian Hauser wrote: Hello J2EE programmers I wrote

Re: HttpSessionListener: Negative session count

2003-08-14 Thread Christian Hauser
Hi Yoav That could be the problem as well. So if the server is restarted my session counter variable is set to 0, but there might still be 30 active sessions. I didn't think of that problem, because I thought that the sessions would be invalidated when the server is restarted. Has anyone a

Re: HttpServletRequest not found from within library

2003-08-14 Thread Christian Hauser
only need it on compile time, and restart Tomcat. Let me know if this worked for you. Yiannis. -Original Message- From: Christian Hauser [mailto:[EMAIL PROTECTED] Sent: 13 August 2003 09:36 To: Tomcat Users List Subject: HttpServletRequest not found from within library Hello all I'm

Re: Multiple Tomcat instances

2003-08-14 Thread Christian Hauser
Angus Mezick wrote: Can the developers have a tomcat instance running inside of eclipse on their desktops? This will allow them do use the debugger. --Angus I haven't yet thought about that. I guess it should be possible, in fact it would be great if that works. Do you know how simple that

HttpServletRequest not found from within library

2003-08-14 Thread Christian Hauser
Hello all I'm using Tomcat 4.1.24 and have the following problem. In a JSP file I have a bean called nav pointing to a class some.package.Navigation. This class is located at a JAR file in the lib directory of the web application. ... jsp:useBean id=nav class=some.package.Navigation

Re: HttpSessionListener: Negative session count

2003-08-14 Thread Christian Hauser
Thank you very much, Ralph. Regards, Christian Ralph Einfeldt wrote: 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

System properties

2003-08-14 Thread Christian Hauser
Hello I'd like to know how I can set system properties when starting Tomcat 4.1. I mean those properties that I can get from within a JSP file as: System.getProperty(CONFIG_HOME) Thank you in advance for any hint. Christian

HttpSessionListener: Negative session count

2003-08-12 Thread Christian Hauser
Hello J2EE programmers I wrote a JSP some time ago that uses a class SessionCounter (which implements HttpSessionListener) to count the active sessions of a web application and to display them. Unfortunately there seems to be a problem with my program, because the web application says that

Re: System properties

2003-08-06 Thread Christian Hauser
Tim Funk wrote: http://jakarta.apache.org/tomcat/faq/misc.html#properties -Tim Thank you Tim for pointing me to the right place. But what do I have to do if I would like to set more than one system property? export JAVA_OPTS='-DpropName1=propValue1 -DpropName2=propValue2' ??? Regards,

Multiple Tomcat instances

2003-08-05 Thread Christian Hauser
Hello Tomcat cracks I'm new to Tomcat administration and would like to switch from ServletExec to Tomcat 4.1. However, I have some difficulty understanding how to set up different Tomcat instances. I'd like to have different Tomcat instances for each developer (to test web applications) and