tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Plukker <rich...@bowtie.nl>
Subject Re: Initializing Application at startup
Date Mon, 01 Jul 2002 12:34:10 GMT
You could envoke the constructor of your initialize class from a servlet.
You should use the init method. If you use load at startup in your 
web.xml you can
garantee that the initialisation of you app is done when tomcat starts.

For the path properties, you can also use the contextParams, this way 
you put the path of you config.file as a context param in your web.xml.

please read the documentation and look at the examples, it's all there.

succes,
Richard


maarten roosendaal wrote:

>Hi,
>
>I've build an Initialize-class which reads in several
>.properties-files. What i want is that when Tomcat
>starts and my webapplication is started, that the
>Initialize-class is called so that it can read in alle
>the .properties-files.
>
>How do i tell Tomcat (or my webapp) to initialize this
>class (to call the initialize-method) and where do i
>need to specify these .properties-files? For example i
>defined a static String:
>PROPERTIESFILE_NAME 		=
>"application.initializer.configuratie";
>in my initialize-class. This String should somewhere
>be defined as application.initializer.configuratie=
>application.properties. I should be able to read the
>content of this file through:
>String propertiesfileName =
>System.getProperty(Initializer.PROPERTIESFILE_NAME);
>
>But i'm not sure how to call/initialize the class and
>where to place/define the .properties-files. Hope
>someone can help me.
>
>Thanks,
>Maarten
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! - Official partner of 2002 FIFA World Cup
>http://fifaworldcup.yahoo.com
>
>--
>To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>
>
>
>  
>




--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message