-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Uma,

Uma Kalluru wrote:
> If I specify a servlet to load-on-start, when will the container unload this
> servlet? Does the container un-load the servlet when the Servlet has no
> incoming requests?

I don't believe there's any standard behavior specified by the servlet
spec for when a servlet will be taken out of service. My guess is that a
servlet would never be taken out of service by a servlet container,
mostly because the overhead of managing that process would be worse than
simply letting it live in memory for the life of the server.

But you should not rely on this fact, because it's not in the
specification anywhere.

> If I need the servlet to be unloaded only when the container stops, how do I
> do this?

Does the servlet contain some special data or something? You're not
supposed to do that. If you need long-living objects available for your
application, you should be using a ServletContextListener to load them
on context start and then un-load them on context stop. The logical
place to store these objects in the meantime is in the ServletContext
(application scope) or in JNDI somewhere.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHKfB89CaO5/Lv0PARArSbAJ44eOuTJbkegTWKxTTXCDpLyDzDNACfQvO7
qMPCNGe5eJLc8ZJ0opRaIKE=
=Vjm4
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to