tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Balazuc" <>
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("") 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.


----- Original Message -----
From: "MacDonald, Todd" <>
To: "Tomcat-User (E-mail)" <>
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
> 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
> it?
> I'm trying hard not to modify the default configuration of T4 much until I
> know more about it.
> -T
> --
> To unsubscribe:   <>
> For additional commands: <>
> Troubles with the list: <>

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message