On Tue, April 26, 2005 1:13 am, Craig McClanahan said:
> This exact same code will also work if you had your DTD at
> "/WEB-INF/lib/classes/my/app/myConfig.dtd" -- because the
> WEB-INF/classes directory is also placed on the classpath for you.
That's what Wendy said too. Makes sense (now) :)
> PUBLIC is definitely what you want for this sort of thing. There's
> also conventional formats for the public identifier and system
> identifier if this DTD was going to be a public thing ... but it
> doesn't matter for application private things.
I need to go do a little reading on DOCTYPE because it doesn't seem to
have *quite* the meaning I thought it had. Just different enough for
something like this to bite me basically :)
> Now that you got this working (sorry I didn't get a chance to respond
> earlier) ...
No problem. Wendy was helpful in nudging me in the right direction.
> there actually is a way to access resources that are in
> WEB-INF but not in the classpath. That's because ServletContext has
> getResource() and getResourceAsStream() methods just like Class does.
>
> ServletContext context = ...;
> URL cURL = context.getResource("/WEB-INF/myConfig.dtd");
> digester.register("myConfig", cURL.toString());
Ironically, I do this in another application where I'm parsing an app
config file manually (written before I discovered Digester), and it looks
virtualy identical to what you have here :) Although, I'm not sure in my
head I knew there was a difference between getResource called on Class vs.
called on ServletContext, but it seems obvious now there would be :) Good
info in case.
Frank
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]