getResource returns null but getResourceAsStream work.. pls help.
807589Sep 3 2008 — edited Sep 3 2008Hi,
I have a web application deployed on a web logic server. I need to read a custom xml file from the public_html\WEB-INF folder.
input = ctx.getResourceAsStream("WEB-INF/myfile.xml"); // works fine
try {
URL u = ctx.getResource("WEB-INF/myfile.xml"); // return null.
Any idea why the url is not working?
2) Is there any way I can read the file outside the servlet context? I mean, in a utility class rather than in a servlet?
Thanks for the help.