users
[Top] [All Lists]

Re: [cinjug-users] DTD path problem.

To: "James Carman" <james@xxxxxxxxxxxxxxxxxxxx>, "Eric Galluzzo" <egalluzzo@xxxxxxxxxxxxxxx>, "Edward Sumerfield" <esumerfd@xxxxxxxxxxx>
Subject: Re: [cinjug-users] DTD path problem.
From: "James Carman" <james@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 16 Jun 2003 13:01:19 -0400
Cc: "CinJug" <users@xxxxxxxxxx>
Delivered-to: mailing list users@cinjug.org
Mailing-list: contact users-help@cinjug.org; run by ezmlm
References: <001301c33421$558cc5c0$6401a8c0@esumerfd> <3EEDEEFE.8040905@einnovation.com> <001701c33427$a45e53c0$6501a8c0@NAMRAC2247>
What version of Struts are you using?  I'm using the RC1 of Struts 1.1.  I DO get a problem with the validator plugin when it tries to initialize if I disable my network card.  Maybe that's a bug.  It shouldn't do that.  Have you checked the bug database at Apache?
----- Original Message -----
Cc: CinJug
Sent: Monday, June 16, 2003 12:52 PM
Subject: Re: [cinjug-users] DTD path problem.

Just turn off validating for your struts action servlet (set via an initialization parameter).  See if that works.
 
----- Original Message -----
Cc: CinJug
Sent: Monday, June 16, 2003 12:23 PM
Subject: Re: [cinjug-users] DTD path problem.

Edward Sumerfield wrote:
To avoid net requests during XML parser loads I have changed all the DTD paths to local files with a little ant task to replace the "DOCROOT" with the expected deployment directory. This allows me to configure the deployment directory at build time so each developer can drive their own deployment with their own build.properties file.
 
 <!DOCTYPE struts-config PUBLIC
         
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
          "file://DOCROOT/WEB-INF/struts-config_1_1.dtd">
 
Except, the SunOne App Server changes the deploy directory each time the product is deployed, putting the docroot into a numbered directory that changes so there no way to know the directory prior to deployment.
 
Anyone have any strategies to accomplish net independence and install directory isolation at the same time?
Here are three ideas; some of these may be more palatable than others. :)
  1. Leave out the <!DOCTYPE> declaration.  Everything should continue to work correctly, although if you're using a DTD-aware XML editor, you may lose some content assistance.
  2. Install your own SAX EntityResolver in whatever SAX parser you're using in order to replace the particular public ID (e.g. "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN") with an InputSource of your choice.  You could read the DTD out of a jar via getClass().getResourceAsStream() and wrap that in an InputSource.  Unfortunately, you may not have access to the SAX parser that's reading the config file...but then again, you may.  (By the way, I think Log4J uses this technique, if you need an example.)
  3. Use some sort of fake URL, like that supplied by the project at http://rachel.sourceforge.net/, to read your DTD out of your jar.
Hope that helps!
- Eric
<Prev in Thread] Current Thread [Next in Thread>