-
From: Mark [mailto:[EMAIL PROTECTED]]
Sent: 18 April 2001 16:08
To: [EMAIL PROTECTED]
Subject: Re: How to read property files?
>
> InputStream is =
this.getClass().getResourceAsStream("myapp.properties");
> Properties p = new Properties();
> try
d up
>
> Filip
>
> ~
> Namaste - I bow to the divine in you
> ~
> Filip Hanik
> Software Architect
> [EMAIL PROTECTED]
> www.filip.net
>
>> -Original Message-
>> From: Samson, Lyndon [IT] [mailto:[EMAIL PROTECTED]]
>> Sent: Wednesday, Apri
in you
~
Filip Hanik
Software Architect
[EMAIL PROTECTED]
www.filip.net
> -Original Message-
> From: Samson, Lyndon [IT] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 18, 2001 8:30 AM
> To: [EMAIL PROTECTED]
> Subject: RE: How to read property files?
>
>
> M
don [IT]" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 18, 2001 10:42 AM
Subject: RE: How to read property files?
> Works fine for me? My jar file had a manifest, a class ( default package )
> and a properties file. I added the jar to the CLASSPATH and execu
uot; <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 18, 2001 10:42 AM
Subject: RE: How to read property files?
> Works fine for me? My jar file had a manifest, a class ( default package )
> and a properties file. I added the jar to the CLASSPATH and executed the
>
-
From: Mark [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 18, 2001 3:08 PM
To: [EMAIL PROTECTED]
Subject: Re: How to read property files?
>
> InputStream is =
this.getClass().getResourceAsStream("myapp.properties");
> Properties p = new Properties();
> try
able.
sam
- Original Message -
From: "Mark" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 18, 2001 3:08 PM
Subject: Re: How to read property files?
> >
> > InputStream is =
> this.getClass().getResourceAsStream("myapp.properties
>
> InputStream is =
this.getClass().getResourceAsStream("myapp.properties");
> Properties p = new Properties();
> try {
> p.load(is);
> } catch ( java.io.IOException e ) {
> // Can't load props file
> }
>
> That way the properties file can be anywhere in the classpath.
>
>
Have
[EMAIL PROTECTED]]
> Sent: Wednesday, April 18, 2001 9:25 AM
> To: [EMAIL PROTECTED]
> Subject: Re: How to read property files?
>
>
> Thanks, this helps me.
> I was wondering though, can you determine where it found the
> properties
> file at?
> Thanks.
> -jim
>
t;Jim Willeke" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 18, 2001 2:25 PM
Subject: Re: How to read property files?
> Thanks, this helps me.
> I was wondering though, can you determine where it found the properties
> file at?
> Thanks.
> -jim
>
Thanks, this helps me.
I was wondering though, can you determine where it found the properties
file at?
Thanks.
-jim
Samson, Lyndon [IT] wrote:
> This works a treat for me
>
> InputStream is = this.getClass().getResourceAsStream("myapp.properties");
> Properties p = new Properties();
> t
This works a treat for me
InputStream is = this.getClass().getResourceAsStream("myapp.properties");
Properties p = new Properties();
try {
p.load(is);
} catch ( java.io.IOException e ) {
// Can't load props file
}
That way the properties file can be anywhere in the classpath.
Could you get the resource URL of the class loading the properties file, and
then strip off the package and class name? e.g. if Im loading bob.properties
from class Bob in package com/fred/, my resource url for the class would be
/usr/tomcat/webapps/mycontext/WEB-INF/classes/com/fred/Bob.class. If
13 matches
Mail list logo