atom feed7 messages in org.apache.tomcat.usersRE: Context lifecycle Listener config...
FromSent OnAttachments
Durham David Cntr 805CSS/SCBEJul 10, 2002 12:21 pm 
Shapira, YoavJul 10, 2002 12:31 pm 
Durham David Cntr 805CSS/SCBEJul 10, 2002 12:34 pm 
Shapira, YoavJul 10, 2002 12:39 pm 
Durham David Cntr 805CSS/SCBEJul 10, 2002 12:47 pm 
Craig R. McClanahanJul 10, 2002 12:56 pm 
Craig R. McClanahanJul 10, 2002 12:59 pm 
Subject:RE: Context lifecycle Listener configuration
From:Craig R. McClanahan (crai@apache.org)
Date:Jul 10, 2002 12:56:57 pm
List:org.apache.tomcat.users

On Wed, 10 Jul 2002, Shapira, Yoav wrote:

Date: Wed, 10 Jul 2002 15:31:37 -0400 From: "Shapira, Yoav" <Yoav@mpi.com> Reply-To: Tomcat Users List <tomc@jakarta.apache.org> To: Tomcat Users List <tomc@jakarta.apache.org> Subject: RE: Context lifecycle Listener configuration

Howdy, There is no .... Just create a class that implements the lifecycle listener interface, and put <listener className="your.class.name" /> in the deployment descriptors. C'est tout.

The only additional remark I would add is that you can also configure arbitrary JavaBeans properties of your listener class, simply by making sure that you use attributes whose names match the underlying property names. This is the way all standard Tomcat components are configured. (And don't forget to put your implementation class under server/classes, server/lib, common/classes, or common/lib.)

It would also be worth investigating whether you can accomplish your goals by using a ServletContextListener (defined in Servlet 2.3), which is portable across all 2.3 containers, instead of Tomcat specific facilities. The contextInitialized() and contextDestroyed() methods are called when your webapp is started up and shut down (respectively), and it's perfect for doing one-time startup and shutdown things.

Yoav Shapira Millennium ChemInformatics

Craig

-----Original Message----- From: Durham David Cntr 805CSS/SCBE [mailto:Davi@scott.af.mil] Sent: Wednesday, July 10, 2002 3:21 PM To: tomc@jakarta.apache.org Subject: Context lifecycle Listener configuration

Can anyone tell me the syntax for adding an on-start listener to a context in tomcat 4

The manual doesn't have much on it other than <Listener className="blah.blah" .../>

What's the ...

Thanks,