Nuno,

> I have a web-service that i'am trying to pack it in a war file.
> I am trying to store configuration files into WEB-INF/data directory. In
> my web-service init method, I have to load the configuration file that
> was stored in WEB-INF/data directory. Is it possible? How can I do it?

(from a servlet)

InputStream in = getServletContext()
                .getResourceAsStream("/WEB-INF/your.file")

Another poster used ServletContext.getRealPath(), but that won't work if
you have an unexpanded WAR file at work. This one should work all the time.

Don't forget to read the documentation on this method and to check for null!

-chris

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to