2008/6/23 Chris Pratt <[EMAIL PROTECTED]>:

> If you look at the <!DOCTYPE of the struts.xml file it explicitly
> states that the location of the DTD is
> http://struts.apache.org/dtds/struts-2.0.dtd.  Since there is no way
> to put something like this on the CLASSPATH, the only way I know of to
> stop the XML libraries from loading this DTD remotely during
> validation is to turn validation off.  But, of course, I could be
> wrong.


Sorry, Chris, but that "location" most definitely is NOT a URL, even though
it looks like one.  It's only the official (and unique) reference name for
that particular DTD.  (That's not something specific to Struts, but it's
similar with any DTD.)

In this case, it refers to the DTD stored inside struts2-core-2.1.2.jar (or
the equivalent jar file, if using a different version of Struts).  Let's
have a look inside that jar file.  The jar file contains the file
struts-2.0.dtd which contains the following comment:
<!--
   Struts configuration DTD.
   Use the following DOCTYPE

   <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd";>
-->
(The rest of that file defines the DTD itself;  no need to fetch from
abroad;  it's all there, available locally on my classpath.)

Now, I am no specialist of DTD syntax, therefore I cannot judge if
everything is exactly as it should be inside struts-2.0.dtd, but I assume
that's the case, since no one else seems to have reported some major problem
here...

Therefore my original question remains:  Why, oh why does Struts feel the
need to access the internet on startup?
(Subsidiary question: where does one get hold of the source code for
com.opensymphony.xwork2?  I briefly looked on opensymphony.com and quickly
got confused!)

Reply via email to