tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Unexpected reload of MainServlet
Date Thu, 09 Jan 2003 18:50:28 GMT
Hi,

>Surely the point of
>being loaded on Tomcat startup is that servlet object is kept in
continuous
>reference for the life cycle of the Tomcat instance - thereby never
being
>garbage collected.

Absolutely not.  That's neither the letter nor the spirit of the spec.
It is, however, a fairly common misconception.

If you want something that's loaded on startup of your context and then
stays there until the context is destroyed, use a <listener> (possibly
one that implements ServletContextListener).

Servlets, including load-on-startup servlets, should not assume they
will be in memory for the lifetime of the server.

Yoav Shapira
Millennium ChemInformatics

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message