Looking at the xml spec (1.0, second edition, section 4.2.2) it appears as
though entities should be processed as relative to the resource within which
they appear.

The spec does allow for special circumstances that change the default
relativity - but why would tiles and validator need to do this? And why
would they change it to be %SystemRoot% (on my system, they appear to both
be relative to c:\windows\system)

Looking through the tiles parser code and the struts-config.xml parser code,
I can see no difference - nothing that sets the "entity root" to be
different, and there is nothing in the dtd from what I can tell.

I can run the xml file with the relative path through a validating parser
and it validates perfectly, reading the included entity as it should.

I am left with 2 decisions on this then. Either there is some sort of
(weird) requirement in tiles and validator (maybe all plugins that use
config files?) that the default relative path for entities needs to change
to %Systemroot% and that requirement DOESN'T exists for the struts-config
files. Else, there is some sort of bug in both of their parsers which
changes the relative path. I can't seem to find it though otherwise I would
fix it myself.

Let me know what you all think.

Thanks,
Matt Bathje

----- Original Message ----- 
From: "Hubert Rabago" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, January 28, 2004 5:31 PM
Subject: Re: entity includes in tiles-defs.xml (again)


> Hi Matt,
>
> I ran into the same problem (with the same error message) when I tried
> using my own DTDs for XML files that Digester was processing.  I found
> that the solution is to put my DTD in the apps' class path, and then
> register my dtd with the Digester instance which parses my config file.
>
> I'm not sure if the solution that worked for me would work for you.
> I don't know if there's a way you can register a resource in such a
> way that allows it to be recognized by the digester instance that
> the tiles plugin uses.  If there is, then that would solve your problem.
> If not, it seems like you'd have to implementing your own tiles xml
> digester, register the dtd with that instance, and parse your XML.
> Looking at the tiles plugin source code, the class which does
> the actual parsing is buried deep.  Look at
> org.apache.struts.tiles.xmlDefinition.XmlParser.
> I didn't dig deep enough to see if you can configure its factory so
> that your customized parse could be called instead.
>
> Maybe one of the Tiles developers can help.
>
> - Hubert
>
> --- Matt Bathje <[EMAIL PROTECTED]> wrote:
> > James -
> >
> > I'm 99.999% sure that spelling is not the issue. To test this out, I am
just
> > cutting the path out and leaving the filename. Since it works with the
path,
> > I am deducing that the filename is correct.
> >
> > What other information can I give you to help? Unfortunatley I can't
give
> > you my entire application - but I was able to duplicate it in
struts-example
> > using validation.xml.
> >
> > I created a file in WEB-INF called testValidationInclude.xml and
cut/paste
> > the registrationForm validator into it out of validation.xml. Then in
> > validation.xml I created an entity using the following syntax:
> >
> > <!DOCTYPE form-validation PUBLIC
> >     "-//Apache Software Foundation//DTD Commons Validator Rules
> > Configuration 1.0//EN"
> > "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd";
> > [
> > <!ENTITY testinclude SYSTEM
> >
"C:\apache_group\tomcat\Tomcat_4_1_24\webapps\struts-example\WEB-INF\testVal
> > idationInclude.xml">
> > ]>
> >
> >
> > and where the registrationForm was, I put &testinclude;
> >
> > This works without a problem
> >
> > When I change the entity definition to:
> >
> > <!DOCTYPE form-validation PUBLIC
> >     "-//Apache Software Foundation//DTD Commons Validator Rules
> > Configuration 1.0//EN"
> > "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd";
> > [
> > <!ENTITY testinclude SYSTEM "testValidationInclude.xml">
> > ]>
> >
> > I get an error:
> >
> > Jan 28, 2004 4:35:17 PM org.apache.struts.validator.ValidatorPlugIn
> > initResources
> > INFO: Loading validation rules file from '/WEB-INF/validation.xml'
> > Jan 28, 2004 4:35:17 PM org.apache.struts.validator.ValidatorPlugIn
> > initResources
> > SEVERE: C:\WINDOWS\system32\testValidationInclude.xml (The system cannot
> > find the file specified)
> > java.io.FileNotFoundException:
C:\WINDOWS\system32\testValidationInclude.xml
> > (The system cannot find the file specified)
> >  at java.io.FileInputStream.open(Native Method)
> >
> >
> > There are a bunch more lines, I can get them for you if you want.
> >
> > Let me know what else may be helpful to you.
> >
> > Thanks,
> > Matt Bathje
> >
> >
> >
> > ----- Original Message ----- 
> > From: "James Mitchell" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Wednesday, January 28, 2004 4:20 PM
> > Subject: Re: entity includes in tiles-defs.xml (again)
> >
> >
> > > Sorry, I thought you *wanted* to specify it directly.
> > >
> > > >From what you've said below, that's an odd problem and my first
> > inclination
> > > would be to check and recheck the spelling.  Other than that, I'm not
sure
> > > without having more information or having the project right here in
front
> > of
> > > me.
> > >
> > >
> > >
> > > --
> > > James Mitchell
> > > Software Engineer / Struts Evangelist
> > > http://www.struts-atlanta.org
> > > 678.910.8017 (cell)
> > > AIM: jmitchtx
> > > MSN: [EMAIL PROTECTED]
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: "Matt Bathje" <[EMAIL PROTECTED]>
> > > To: "strutslist" <[EMAIL PROTECTED]>
> > > Sent: Wednesday, January 28, 2004 2:52 PM
> > > Subject: Re: entity includes in tiles-defs.xml (again)
> > >
> > >
> > > > Hi James, thanks for the answer. Unfortunatley it somehow wound up
in my
> > > > spam box...
> > > >
> > > > This doesn't really solve the problem. I don't care about having to
put
> > > the
> > > > c:\ in the entity - what I care about is having to put
> > > > /Inetpub_Tomcat/rsg_java/struts/pub in there. The application I am
> > working
> > > > on will have multiple instantations, and the installation path will
> > change
> > > > with each one.
> > > >
> > > > What I am looking for is a solution that allows me to put in just
the
> > file
> > > > name (as you can do in struts-config files) or a path relative to
> > WEB-INF.
> > > >
> > > >
> > > > Thanks,
> > > > Matt Bathje
> > > >
> > > >
> > > >
> > > > ----- Original Message -----
> > > > >     Date: Mon, 26 Jan 2004 13:17:25 -0500
> > > > >     From: James Mitchell <[EMAIL PROTECTED]>
> > > > > Reply-To: Struts Users Mailing List
<[EMAIL PROTECTED]>
> > > > >  Subject: Re: entity includes in tiles-defs.xml (again)
> > > > >       To: Struts Users Mailing List
<[EMAIL PROTECTED]>
> > > > >
> > > > > Try changing this:
> > > > > > Here is what DOES work in tiles-defs:
> > > > > > <!ENTITY kurt-tiledefs SYSTEM
> > > > > >
> > > >
> >
"C:\Inetpub_Tomcat\rsg_java\struts\pub\WEB-INF\kurt-admin-tilesdefs.xml">
> > > > > >
> > > > >
> > > > > to this
> > > > > <!ENTITY kurt-tiledefs SYSTEM
> > > > >
> > "/Inetpub_Tomcat/rsg_java/struts/pub/WEB-INF/kurt-admin-tilesdefs.xml">
> > > > >
> > > > >
> > > > > ....normally, "/" will be interpreted as "C:\" or to be more
> > > > > specific....your system's %SystemDrive%
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > James Mitchell
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Matt Bathje" <[EMAIL PROTECTED]>
> > > > > To: "strutslist" <[EMAIL PROTECTED]>
> > > > > Sent: Monday, January 26, 2004 12:04 PM
> > > > > Subject: entity includes in tiles-defs.xml (again)
> > > > >
> > > > >
> > > > > > Hi, I asked this question a month or 2 ago, and never got a
> > response,
> > > so
> > > > > > thought I'd try again -
> > > > > >
> > > > > > Using XML entities, I was able to get my struts-config file
broken
> > up
> > > > into
> > > > > > multiple files.
> > > > > >
> > > > > > I am attempting the same thing on my tile-defs.xml file, and
when I
> > do
> > > > it,
> > > > > I
> > > > > > get the following error:
> > > > > >
> > > > > > 12/16/03 10:56:55 AMERROR org.apache.struts.tiles.TilesPlugin
init -
> > > > Can't
> > > > > > create Tiles definition factory for module ''.
> > > > > > ServletInitError: javax.servlet.ServletException: IO Error while
> > > parsing
> > > > > > file '/WEB-INF/tiles-defs-admin.xml'.
> > > > > > C:\WINDOWS\system32\kurt-admin-tilesdefs.xml (The system cannot
find
> > > the
> > > > > > file specified)
> > > > > >
> > > > > >
> > > > > > So, just to be stupid, I put the full path to the file in the
XML
> > > > enitity
> > > > > > declaration, and that makes it work - but I don't want to have
to
> > hard
> > > > > code
> > > > > > that path in.
> > > > > >
> > > > > >
> > > > > > Here is what works in struts-config:
> > > > > > <!ENTITY kurt-actionmappings SYSTEM
"kurt-admin-actionmappings.xml">
> > > > > >
> >
> === message truncated ===
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free web site building tool. Try it!
> http://webhosting.yahoo.com/ps/sb/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to