jakarta-tomcat-5.0.18
Windows 2000

I cannot get SSI (server side includes) to work from one context to
another.  I CAN get it to work from one context to the ROOT context but
not anywhere else.

I have an index.html file with the following virtual include:

<!--#include virtual="/zinc/bdyhdr4.txt" -->

index.html is located in 'stx.war' deployed under webapps.  zinc is a
separate context under webapps and contains bdyhdr4.txt.

webapps
    |
    |
    ROOT
    |
    |
    stx
      |
      | index.html
    |
    |
    zinc
      |
      | bdyhdr4.txt

I have enabled the SSI servlet, set 'isVirtualWebappRelative' to 0, and
changed the crossContext="true" in both the stx.xml and zinc.xml files
located in C:\Program Files\Apache Software Foundation\Tomcat
5.0\conf\Catalina\localhost.

When viewing 'index.html', an error message "an error occurred while
processing this directive" appears where the text from the #include
should be.  The Tomcat log file shows:

StandardContext[/stx]ssi:
SSIServletExternalResolver.getServletContextAndPath( /zinc/bdyhdr4.txt,
true)
StandardContext[/stx]ssi: #include--Couldn't include file: /zinc/bdyhdr4.txt
java.io.IOException: Couldn't find file: /bdyhdr4.txt
at
org.apache.catalina.ssi.SSIServletExternalResolver.getFileText(SSIServletExternalResolver.java:420)
at org.apache.catalina.ssi.SSIMediator.getFileText(SSIMediator.java:190)




Here's the strange part. If I copy the bdyhdr4.txt file to the ROOT
context, the include works. It seems as if Tomcat is resolving the
context to 'ROOT' instead of 'zinc'. I did add a connector so that port 80 is used in addition to port 8080.


<Connector port="80" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" />


Any ideas?  I've tried creating a 'zinc' subdirectory in 'ROOT' and
eliminating the 'zinc' context under webapps.  I've tried adding a zinc
subdirectory in 'jsp-examples' and changing the code to <!--#include
virtual="/jsp-examples/bdyhdr4.txt" --> to see if crossContext is working.

Thanks!







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



Reply via email to