You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Julia Kuznetsov <ju...@modusmedia.com> on 2001/06/27 19:34:49 UTC

How to specify a startup servlet for an application (CONTEXT)?

I need to load couple xml files into memory and store them in ServletContext
when my application starts. I created a servlet to do that, but I can't
figure out how to make this servlet run automatically whem the app starts.
Is there smthg in server.xml that I can define to run this servlet?

Please help!

Julia Kuznetsov


Re: How to specify a startup servlet for an application (CONTEXT)?

Posted by Milt Epstein <me...@uiuc.edu>.
On Wed, 27 Jun 2001, Julia Kuznetsov wrote:

> I need to load couple xml files into memory and store them in
> ServletContext when my application starts. I created a servlet to do
> that, but I can't figure out how to make this servlet run
> automatically whem the app starts.  Is there smthg in server.xml
> that I can define to run this servlet?

If I understand you right, you can put a load-on-startup tag in the
servlet definition tag in the context's web.xml file to take care of
this.

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
mepstein@uiuc.edu