tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Balazuc" <denis.bala...@trader.com>
Subject Re: Where to put .properties so web app finds it
Date Wed, 14 Nov 2001 01:19:16 GMT
We use property files to configure our framework when it gets loaded by
Tomcat through the WAR files.
The most convenient place we've found for those files is under
WEB-INF/classes as it is the root of the classpath of your WAR app
and you can retrieve your file using
ClassLoader.getResource("property.properties") without having to parse or
create any URL or the like...

So, it seems a convenient place to do so.
You could as well have an entry in web.xml telling your framework where the
property files are located, but you will have to find a mean to retrieve
this setting. It is not so good if your framework is not servlet-oriented
(in this case, you don't have direct access to ServletConfig, where the
setting will be located).

You can also use a -D on the Tomcat command line (by using TOMCAT_OPTS in
Tomcat's startup scripts) but this is the worst scenario as you have to
modify a file that does belong to Tomcat and not to your App.

Hope this helps.

Denis


----- Original Message -----
From: "MacDonald, Todd" <Todd_MacDonald@tvratings.com>
To: "Tomcat-User (E-mail)" <tomcat-user@jakarta.apache.org>
Sent: Tuesday, November 13, 2001 5:59 PM
Subject: Where to put .properties so web app finds it


> I've got a .properties file for settings in the web app that might be
> configured differently depending on which server the .war might be
dropped.
>
> It obviously doesn't belong in the .war itself.  Where is the recommended
> place to put such configuration files in Tomcat 4 so that the app will
find
> it?
>
> I'm trying hard not to modify the default configuration of T4 much until I
> know more about it.
>
> -T
>
> --
> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>



--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message