In the J2EE blueprint, there is an example of a configuration file
residing in the /WEB-INF/ directory which is loaded using getResource(),
see eg. http://java.sun.com/j2ee/blueprints/sample_application/qanda/

excerpt;

"Here is some sample code that gets a configuration file from the
WEB-INF/ directory and parses it as XML.

URL myURL = null;
try {
    myURL = context.getResource("/WEB-INF/mysettings.xml");
} catch (java.net.MalformedURLException ex) {
    System.out.println("Malformed URL exception: " + ex);
}

..."

However, when doing this in tomcat 4.0dev (April 24th snapshot), the
getResource() method only returns null.

Is this supported in tomcat, or does getResource() only return things
that are in the classpath?

I there any other "nice" way of loading a property / xml / other file
from the WEb-INF directory?


-- 
- Torgeir

Reply via email to