Martin, thanks for replying.

I agree with what you are saying, but my point is that <!--#include 
virtual="/head.html" --> should work from any subdirectory
/Foo or /Foo/Moo or /Foo/Moo/TooFoo because the isVirtualWebappRelative 
parameter is set to true. Which means the "virtual" path should be interpreted 
as relative to the context root.

If the current directory is /Foo or /Too/Moo, <!--#include virtual="/head.html" 
--> should still work. 
if in /Foo, <!--#include virtual="../head.html" --> this will also work
in in /Foo/Moo <!--#include virtual="../../head.html" --> should work too

Setting isVirtualWebappRelative to true or false has worked fine for me with 
previous versions of Tomcat, but not with Tomcat 5.5. This makes migrating 
sites very difficult. A developer shouldn't be changing the code every time the 
web server version is upgraded.

Ross

-----Original Message-----
From: Martin Gainty [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 16, 2006 5:49 AM
To: Tomcat Users List
Subject: Re: isVirtualWebappRelative not working


Good Morning Ross-
If your path does not begin with a slash (/) then it is taken to be *relative 
to the current document*

<!--#include virtual="/head.html" --> --Include head.html (head.html current 
location loads correctly)
<!--#include virtual="/Foo/Foo.html" --> --Include in Foo.html (Foo.html loads 
current location)

from Foo folder note the absence of "/" in the first position so this is the 
relative to current document
<!--#include virtual="../header.html" --> --Include in the original head.html

NB:
Use #include virtual instead of #exec cgi to pass QueryStrings

More info available at
http://httpd.apache.org/docs/1.3/mod/mod_include.html

HTH,
Martin--
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.




> Hi everybody,
> 
> I'm having issues with isVirtualWebappRelative parameter when configuring the 
> SSIServlet. It just won't work for me. I have set up the value to 1 to make 
> the path be interpreted as relative to the context root, but I'm still 
> getting the following output in catalina.out:
> 
> ...
> SEVERE: #include--Couldn't include file: /head.html
> java.io.IOException: Couldn't find file: /head.html
>        at 
> org.apache.catalina.ssi.SSIServletExternalResolver.getFileText(SSIServletExternalResolver.java:537)
>        at 
> org.apache.catalina.ssi.SSIMediator.getFileText(SSIMediator.java:155)
>        at org.apache.catalina.ssi.SSIInclude.process(SSIInclude.java:44)
> ...
> 
> The file, head.html, exists in the context root and everything works fine 
> when a file from the same directory is including it via <!--#include 
> virtual="/head.html"--> The problem comes when a file from a subdirectory 
> tries to include it.
> 
> I'm testing this with Tomcat 5.5.17 on Linux. The same configuration works 
> fine with Tomcat 5.0.25
> 
> Does anybody know of any bugs related to the isVirtualWebappRelative 
> parameter in Tomcat 5.5? I might have missed something in the configuration, 
> but can't think of it right now.
> 
> Any help and ideas are welcome.
> 
> Thanks,
> Ross
> 
> "This communication is intended solely for the addressee and is confidential 
> and not for third party unauthorized distribution"
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

"This communication is intended solely for the addressee and is confidential 
and not for third party unauthorized distribution"

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to