views:

124

answers:

2

I have some properties file in WEB-INF. And I want to load it as a bundle. Is there any way to do that?

+1  A: 

Put it in WEB-INF/classes. That is part of the classpath.

Kees de Kooter
...which is not necessary for `ExternalContext#getResource()` methods by the way.
BalusC
+4  A: 

Use either ExternalContext#getResource() or ExternalContext#getResourceAsStream() wherein you pass the context-relative URL/path.

E.g.:

properties.load(externalContext.getResourceAsStream("/WEB-INF/file.properties"));
BalusC