commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <>
Subject Re: [Digester] Unable to get validation working
Date Mon, 25 Apr 2005 20:46:09 GMT
From: "Frank W. Zammetti" <>

> In my code, I have this:
> digester.setValidating(true);
> digester.register("myconfig",
> this.getClass().getResource("my-config.dtd").toString());
> That second line throws an NPE.  The my-config.dtd is in WEB-INF.  In my

For getResource(...) to work, wouldn't the file have to be on the classpath,
so in WEB-INF/classes, not directly in WEB-INF?

I load .properties files from WEB-INF/classes with:
         ClassLoader cl = UniSessionFactory.class.getClassLoader();
         InputStream input = cl.getResourceAsStream( propsFileName );
and this seems similar.  The javadocs say that the getResource method
"delegates the call to its class loader" after making some changes.

Wendy Smoak

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message