0

I can't get ssi to work on Tomcat 5.5.27.

using standard ssi configuration and getting this in log

SEVERE: #include--Couldn't include file: /file/hi.html java.io.IOException: Couldn't get context for path: /file/hi.html

I don't know what is the context.

Thanks for help

configuration

<servlet>
    <servlet-name>ssi</servlet-name>
    <servlet-class>
      org.apache.catalina.ssi.SSIServlet
    </servlet-class>
    <init-param>
      <param-name>buffered</param-name>
      <param-value>1</param-value>
    </init-param>
    <init-param>
      <param-name>debug</param-name>
      <param-value>1</param-value>
    </init-param>
    <init-param>
      <param-name>expires</param-name>
      <param-value>666</param-value>
    </init-param>
    <init-param>
      <param-name>inputEncoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
    <init-param>
      <param-name>outputEncoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
    <init-param>
      <param-name>isVirtualWebappRelative</param-name>
      <param-value>0</param-value>
    </init-param>
    <load-on-startup>4</load-on-startup>
</servlet>


<servlet-mapping>
    <servlet-name>ssi</servlet-name>
    <url-pattern>*.shtml</url-pattern>
</servlet-mapping>
Mark Thomas
  • 16,339
  • 1
  • 39
  • 60
tom52
  • 305
  • 2
  • 8

1 Answers1

1

First of all, Tomcat 5.5 has not been supported by the ASF since 30 September 2012. You really need to upgrade. Further 5.5.27 was released in 2008 and there have been a lot of bug fixes and security fixes since then. More good reasons to upgrade.

With the minimal information you have provided (no details on how your app is deployed, no snippet showing the source that triggers this error) it looks like you are trying to do includes relative to the root of the web application without configuring the SSI servlet for that. Setting isVirtualWebappRelative to 1 should do the trick.

Mark Thomas
  • 16,339
  • 1
  • 39
  • 60