tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Question concerning application paths
Date Fri, 03 Jul 2009 02:50:24 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

To whom it may concern,

On 6/23/2009 3:02 AM, smonte@cc.hut.fi wrote:
> I have a an application where other people can deploy their own
> applications. I would like all the applications to use a common library.
> However, when I add some common JARs to a shared [library] I'm having
> some path trouble.

Where are you putting your JAR files? What version of Tomcat are you
running?

> In my XML file at "tomcat/webapps/appName/myXML.xml" I have the
> following path: "WEB-INF/dtd/someDTD.dtd".

Most paths in webapps are either absolute or relative to the webapp
itself. The above looks like it should be relative to the webapp, but
you're asking some code to load it without giving it a point of reference.

> I'm using XSLT to transform
> some XML files and Tomcat always tries to look this "someDTD.dtd" under
> "tomcat/bin/". Naturally the file is not there so I get an error.

What is the XSLT processor using for it's base path? Probably the cwd of
the Java process, which is almost never going to work. Does it try to
load .../tomcat/bin/someDTD.dtd even though you (sort of) told it to
load .../tomcat/bin/WEB-INF/dtd/someDTD.dtd? Or does it try to load that
second one?

> How could I make Tomcat to look for the files under
> "tomcat/webapp/appName/" , not under "tomcat/bin/"?

You could fully-specify the path of the DTD. Or, you could turn off XML
validation in the XSLT processor. You could also write your own DTD
resolver and plug it into the XML parser... but that will be problematic
because you'll need to sniff the current webapp's deployemnt directory
from the request, and then load the DTD relative to that. Good luck :)

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkpNcfAACgkQ9CaO5/Lv0PCengCgiuQVm+mLC7ZTBBDE2i4PYzi6
6mcAn3KH9Fwl4Wa85VkAcc3JLM/pB85H
=tZaZ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message