tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Randolph" <pran...@mail.cslf.org>
Subject RE: A common .properties file
Date Thu, 10 Apr 2003 19:34:16 GMT
I used a different way. I put a file called 'common.properties' in my $CATALINA_HOME/shared/classes
directory and I used this code:

java.util.ResourceBundle rb = java.util.ResourceBundle.getBundle("common");
String prop = rb.getString("my.property");

This is the same way I do it with the .properties files in my WEB-INF/classes directory, so
this works out great for me.


Paul Randolph
CSLF 

-----Original Message-----
From: bahbahbooie@go.com [mailto:bahbahbooie@go.com]
Sent: Thursday, April 10, 2003 6:07 PM
To: Tomcat Users List
Subject: Re: A common .properties file


I guess I never used the 
Thread.currentThread().getContextClassLoader(my.properties) method when I 
tried it.
I was using getClass().getResourceAsStream(my.properties).
Thanks for the tip!


At 10:49 AM 4/10/2003 -0600, you wrote:
>Hmm, it seems to work OK on my box.
>
>I created a 'test.properties' file in $CATALINA_HOME/shared/classes and
>used
>
>Thread.
>  currentThread().
>   getContextClassLoader().
>    getResourceAsStream('test.properties');
>
>And got just what I expected. This is on 4.1.24, maybe you had an older
>version?
>
>Larry
>
> >>> bahbahbooie@go.com 04/10/03 09:37 AM >>>
>If that works I'd love to hear about it.
>The $CATALINA_HOME/shared/classes never worked for me.
>
>
>At 09:06 AM 4/10/2003 -0600, Larry Meadors wrote:
> >If you are loading it with a classloader, you could put it in
> >$CATALINA_HOME/shared/classes and get to it.
> >
> >Larry
> >
> > >>> prandol@mail.cslf.org 04/10/03 08:30 AM >>>
> >I have the same .properties file in a number of my webapps. I am
> >wondering, is it possible to use a common file in some directory to be
> >accessible to all my webapps?


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


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


Mime
View raw message