commons-user mailing list archives

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

> 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.

HTH,
Wendy Smoak


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message