Craig,

I don't know if this is applicable or not, but if I set the new "validating" servlet 
parm to "false", I'll still get parse errors if the <!DOCTYPE ...> tag is in the .xml 
file. I get around this by deleting that tag from the .xml file. With both of these 
elements in place, I don't get any errors during parsing.

FWIW...

Donnie


>>> [EMAIL PROTECTED] 02/23/01 01:07PM >>>
Michael McCallister wrote:

> Struts may include a local copy of the web.xml DTD file, in the case of the
> non-validating parse of web.xml, nothing causes it to be used instead of
> the external system identifier.  ActionServlet.initServlet() creates a new
> Digester, never calls register(), and then calls parse().  We probably need
> some code like this snippet, found in ActionServlet.initDigester():
>
> >         // Register our local copy of the DTDs that we can find
> >         for (int i = 0; i < registrations.length; i += 2) {
> >             URL url = this.getClass().getResource(registrations[i+1]);
> >             if (url != null)
> >                 digester.register(registrations[i], url.toString());
> >         }
>
> It doesn't make intuitive sense (to me), it looks like SAXParser.parse()
> insists on being able to access the DTDs even when it is in non-validating
> mode.
>
> To confirm this, I bumped up the detail level of ActionServlet and now,
> right before the Parse Fatal Error exception, I get the following logged to
> System.out:
>
> >resolveEntity('-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN',
> >'http://
> >java.sun.com/j2ee/dtds/web-app_2_2.dtd')
> >  Not registered, use system identifier
>
> This seems to be the root cause of the bug I filed last night: PR 683.  Of
> course, the bug report only described the symptoms (and poorly at
> that).  Should I file a new bug report with this analysis?
>

Thanks Mike, but it nailed me to (as soon as I tried to run a Struts app on my
disconnected laptop :-), so I know the details now.  I am going to fix this by
including local copies of the relevant web.xml DTDs (for both 2.2 and 2.3) in
the struts.jar file.

>
> Mike
>

Craig



Reply via email to