tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Listener vs. load-on-startup
Date Tue, 24 Apr 2007 12:04:04 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lizhg,

lizhg wrote:
> Hi all, I have some problem with Listener and load-on-startup, I search
> on google and I find this article below, it do a lot good to me, but I
> still want to ask , using the init() [and destroy()] of a servlet 
> [is the same as] using the
> contexInitialized() and the contextDestroyed() of a listener?

It is generally considered good form to set up application-wide
configuration, objects, etc. in a Listener. For this type of use, you
want to use a ServletContextListener specifically (there are other types
of listeners).

If you have a servlet that needs to configure /itself/, then it's
perfectly reasonable to use the servlet's init() method for that purpose.

- -chris

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

iD8DBQFGLfI09CaO5/Lv0PARAqjuAJ0WX1EaGVf6mun6az6cR6/caXe0twCgqCgh
V+Z8d9ig1R2HHbrvy7KfrNU=
=zeEl
-----END PGP SIGNATURE-----

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


Mime
View raw message