tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George McKInney" <geo...@tantalus.com>
Subject RE: RE: how to access a properties file as a resource.
Date Mon, 02 Apr 2001 16:36:50 GMT
Unless there is some reason not to have the properties file in
WEB-INF/classes/ I suggest you put it there.

A project of ours had grown up with a separate WEB-INF/configFiles/
directory, but it turned out to be a real pain. The current build copies the
contents of  the repository's configFiles dir into WEB-INF/classes. It
required a pass through the code that used the properties to access them as:

getResourceAsStream("/"+in_filename);

where the leading slash puts them in the default package,

but the code is much more straight forward and portable.

George McKinney, Developer
Tantalus Communications Inc.
500-1122 Mainland Street
Vancouver, BC, Canada V6B 5L1
george@tantalus.com

Direct  604.726.6753
Main    604.609.0700
Fax     604.609.0705

"The Oracle Experts"
www.tantalus.com


> -----Original Message-----
> From: Alex Colic [mailto:alex.colic@pop-ware.com]
> Sent: Monday, April 02, 2001 9:03 AM
> To: Tomcat-User
> Subject: FW: RE: how to access a properties file as a resource.
>
>
>
>
> But that would mean that the property file is somewhere on
> the class path. I
> want it in the web-inf/ directory.
>
> Do you understand what I mean?
>
>
> >Date: Mon, 2 Apr 2001 06:53:38 -0700
> >To: "'tomcat-user@jakarta.apache.org'"
> <tomcat-user@jakarta.apache.org>
> >From: William Kaufman <WKaufman@viquity.com>
> >Subject: RE: how to access a properties file as a resource.
> >Message-ID: <635802DA64D4D31190D500508B9B04108214E1@dcsrv0>
>
> >Use java.util.ResourceBundle.getBundle().
> >
>                                                             -- Bill K.
>
>


Mime
View raw message