You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alistair Hopkins <al...@berthengron.co.uk> on 2000/08/29 11:08:14 UTC

Re: ConfigFiles

ref earlier answer to me:

To: "'tomcat-user@jakarta.apache.org'" <to...@jakarta.apache.org> 
Subject: RE: Help with properties file locations
Hi,
Use something like the following:
InputStream inputStream =
MessageDb.class.getResourceAsStream("/MessageDb.properties");
And put MessageDb.properties under classes, assuming that
your class file is in com/mysite/support/MessageDb.class.
The idea is that the resource file is looked up under the same
CLASSPATH component under which your class file was found.
The WEB-INF/classes directory is automatically added to the
classpath for the "current" web application.
Hope this helps,
--Amos

At 11:21 AM 8/29/00 +0200, you wrote:
>Servus,
>
>we have to load a configuration-file after starting a session, to determine
>what database to connect and something like that.
>Therefore we want to load a properties-object from a FileStream. Now we have
>to know, where to place the file and how to adress it (URI).
>
>We use Tomcat 3.1 together with the apache WebServer on Linux 2.2.x
>
>Thanx in advance and have a nice day
>
>Wolfgang
>
>--
>Synemedia Productions
>Hildegardstr. 28 | 10715 Berlin, Germany | Tel: +49(0)30-857 32 850
>mail: egger@synemedia.de | www: http://www.synemedia.de


RE: ConfigFiles

Posted by Wolfgang Egger <Eg...@synemedia.de>.
Servus Amos,

> The WEB-INF/classes directory is automatically added to the
> classpath for the "current" web application.
> Hope this helps,

Tanx a lot for your help, its running ....

Have a nice day

        Wolfgang