tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Jacquemont <>
Subject Re: instanciate a servlet when tomcat starts
Date Wed, 09 May 2001 16:45:31 GMT
Hi Sandrine,

You have to change (or create if doesn't exist) the web.xml file that comes 
in the WEB-INF directory.

The example below is the entire content of a web.xml file that loads the 
ServletInit servlet and instantiate it (to the name defined by servlet-name) 
on startup. The load-on-startup property must be different than 0 to have the 
servlet loaded and instantiate at the startup of the app (when tomcat starts).


<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"

> Hi,
> I've a servlet that loads properties from a file to load them in the System
> properties.
> I'd like this servlet to be instanciated when Tomcat starts.
> With Jserv, i used the file.
> I think it must be simple, but i really don't now tomcat and all the
> configuration file!
> Thanks
> Sandrine

View raw message