To read a property from /WEB-INF/classes/com/foo/My.properties
you shouldn't use getSystemResource*() as it uses the
Systemclassloader which doesn't know anything about the tomcat 
directories. So you have use getResource*() which uses the 
classloader that loaded you current class.

To the use of getResource() against getResourceAsStream():
AFAIK the only benefit is that you save one line of code.

Ralph Einfeldt
Uptime Internet Solution Center GmbH
Hamburg, Germany
Hosting, Content Management, Java Consulting
http://www.uptime-isc.de 

> -----Urspr�ngliche Nachricht-----
> Von: petra staub [mailto:[EMAIL PROTECTED]]
> Gesendet: Donnerstag, 1. August 2002 16:45
> An: [EMAIL PROTECTED]
> Betreff: Re: AW: Reading properties file from ClassPath
> (ServletContextListener)
> 
> with classpath i mean somewhere in the package of my
> web application (context). this would match the first
> path you pointed out in your answer 
> (webapps/{Context}/WEB-INF/classes/com/foo/My.properties).
> 
> actually i have no special reason i choose getSystemResource
> instead of getSystemResourceAsStream. what whould be the
> benefit of doing do (maybe buffering related aspects?)?

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to