tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rashmi Rubdi" <rashmi....@gmail.com>
Subject Re: How to load a static class on Tomcat startup
Date Sat, 02 Jun 2007 00:28:52 GMT
On 6/1/07, Caldarale, Charles R <Chuck.Caldarale@unisys.com> wrote:
> > From: Andrea Sacco [mailto:atreyuas@ngi.it]
> > Subject: How to load a static class on Tomcat startup
> >
> > I want to know how I can configure Tomcat to load my
> > Singleton class on his startup routine?


Make the Singleton class implement ServletContextListener ,
and register the Singleton class as a listener in web.xml

The syntax for registering the listener in web.xml is specific to
the version of Tomcat ( Servlet Specification ) you are using.

>
> Sounds like you need a Listener:
> http://tomcat.apache.org/tomcat-6.0-doc/config/engine.html#Lifecycle%20L
> isteners
> http://tomcat.apache.org/tomcat-5.5-doc/config/engine.html#Lifecycle%20L
> isteners
>
>  - Chuck


-Rashmi

---------------------------------------------------------------------
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