commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank W. Zammetti" <fzli...@omnytex.com>
Subject Re: [Digester] Unable to get validation working
Date Mon, 25 Apr 2005 21:39:46 GMT
Makes sense Wendy... I gave it a shot, but still get the NPE on that 
line (must be the toString() call that's actually throwing it).

Wendy Smoak wrote:
> 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
> 
> 
> 
> 
> 

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com


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