tomcat-users mailing list archives

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

>Surely the point of
>being loaded on Tomcat startup is that servlet object is kept in
>reference for the life cycle of the Tomcat instance - thereby never
>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:   <>
For additional commands, e-mail: <>

View raw message