----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
Hi,
Since there is no activity on the list i tought i will break the ice.
I have a question regarding static variables declared in helper classes.
I also put these classes in the servlet directory under different package
names because
i want them reloaded if i change something.
I found this in an article:
"Most Servlet Engines use a special class loader for Servlets to be able to
automatically reload a Servlet when it is modified. This class loader
handles all class files located in a special directory, typically named
servlets. A common mistake among new Servlet developers is to also put
helper classes, such as the connection pool classes described here, in the
servlets directory. This doesn't work at all when static variables are
involved since the special class loader creates a separate class instance
for each Servlet. To avoid this problem you should place all helper classes
in the regular CLASSPATH used by the Servlet Engine. How you set the
CLASSPATH varies between Servlet Engines so read the documentation for the
product you use."
(taken from
http://www.webdevelopersjournal.com/columns/connection_pool.html)
My question is:
This is true in case of Apache+Jserv too?
I mean that i declare a static variable in wain if i put my class under
servlets/ directory?
I really want that these static variables to survive for more than one
client request.
Any comments??
Thank you for reading this,
Andras.
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search Archives:
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]