On Wed, 10 Jul 2002, Shapira, Yoav wrote:
> Date: Wed, 10 Jul 2002 15:31:37 -0400
> From: "Shapira, Yoav" <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> 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:[EMAIL PROTECTED]]
> >Sent: Wednesday, July 10, 2002 3:21 PM
> >To: [EMAIL PROTECTED]
> >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,
> >
> >Dave
> >
> >--
> >To unsubscribe, e-mail: <mailto:tomcat-user-
> >[EMAIL PROTECTED]>
> >For additional commands, e-mail: <mailto:tomcat-user-
> >[EMAIL PROTECTED]>
>
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>