You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Craig R. McClanahan" <Cr...@eng.sun.com> on 2001/02/12 21:01:25 UTC

Re: DTD validation of struts-config.xml

Lee Hall wrote:

> We've been using the Tomcat 3.2 that is integrated with NetBeans to do
> our Struts development.  Our test deployment server (AIX 4.3 with the
> IBM 1.2.2 JVM) is running a vanilla Tomcat3.2.1.  Neither of these
> environments has any problem with the subject of this message. Our
> pre-production server (AIX 4.3 with the IBM 1.2.2 JVM) is running
> Enhydra 3.1 and fails initialization due to the validation done by
> ActionServlet.  We've tried forcing Xerces 1.2 in Enhydra, but Enhydra
> persists in it's attempt to validate using the network URL instead of
> the local resource. I hacked ActionServlet.initDigester() to turn off
> validation and that got us by - but I know it's the wrong way to deal
> with this.  In spite of the Barracuda project, I would hope that the
> Enhydra team would want to be completely Tomcat-compatible (which I
> think includes Struts compatibility). Still, it was easier to "fix"
> the ActionServlet than to fingure out why we are having this problem
> with Enhydra.  I know, I know... I should have extended ActionServlet
> to override instead of butchering my clean Struts - but the question
> remains regarding why this seeming incompatibility exists. Could
> somebody give me a clue?    - Lee

As you can see from the source code in ActionServlet, Struts attempts to
register its local copy of the DTD in the initDigester() method.  It
uses Class.getResource() to actually acquire a URL for reading the
contents of the DTD, which is stored as a resource in the "struts.jar"
file.  If the web application class loader in Enhydra has problems
implementing this method correctly, you could encounter the symptom that
you report (trying to go across the network to grab the DTD).

Craig McClanahan