tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: loading properties file from WEB-INF instead of WEB-INF/classes
Date Mon, 19 Apr 2010 21:29:30 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David,

On 4/18/2010 2:27 PM, David Smith wrote:
> ServletContext.getResource( path ) takes path as relative to the current
> webapp and returns a URL for opening the resource or null if the
> resource was not found.
> 
> also there is --
> 
> ServletContext.getResourceAsStream( path ) takes a path as relative to
> the current webapp and returns an i/o stream for reading the file.

Yes, please use ServletContext.getResourceAsStream.

> both of these are well documented in the servlet spec.

And in the Servlet API itself if you don't want to dig into the spec
just to read the javadoc.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvMyzoACgkQ9CaO5/Lv0PAG5QCgmmoU7Blc/z1Gzkl3uwOvEUmu
K7wAoJwSb/lD3sVxaYpcg0gq/323BMH3
=N2lO
-----END PGP SIGNATURE-----

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


Mime
View raw message