> > I've built an axis web service, and I am reading a properties file
> > using the code below. The problem is that depending on the
[quoted text clipped - 11 lines]
>
> Arne
Can you give me an example of how to do that?
Philipp Taprogge - 20 Apr 2007 22:31 GMT
Hi!
> Can you give me an example of how to do that?
You could do something like this:
class MyClassInsideAWarFile {
public void someMethod() {
Properties props = new Properties();
props.load(this.getClass()
.getResourceAsStream("/WEB-INF/my.properties");
}
}
HTH,
Phil
Lew - 21 Apr 2007 00:29 GMT
> Hi!
>
[quoted text clipped - 10 lines]
> }
> }
Am I right that that will find a file "WEB-INF/my.properties" relative to an
element of the classpath?

Signature
Lew
Arne Vajhøj - 21 Apr 2007 19:04 GMT
>>> I've built an axis web service, and I am reading a properties file
>>> using the code below. The problem is that depending on the
[quoted text clipped - 9 lines]
>
> Can you give me an example of how to do that?
Properties p = new Properties();
p.load(getClassLoader().getResourceAsStream("foobar.properties"));
where foobar.properties are either WEB-INF/classes/foobar.properties
or WEB-INF/lib/something.jar!foobar.properties.
Arne