tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ahmed Hammad" <ahm...@gmail.com>
Subject SSI Filter does not work with JSP
Date Wed, 26 Nov 2008 21:04:29 GMT
Hi,

I am using Tomcat 6.0.18 with java version "1.5.0_09" on Windows XP, here is
my problem.

I want to configure SSI to work with JSP files. I followed instructions at:
http://tomcat.apache.org/tomcat-6.0-doc/ssi-howto.html
I am able to run SSI Servlet on JSP files, but in this case the java code
inside JSP will not be executed, just displayed as it is. When I configure
SSI Filter, the java code is executed but the SSI directive is not evaluated
without giving any error or hint in the Tomcat log files.

I am not using Apache server, just Tomcat. I need JSP with SSI for legacy
reasons.

Here is my test page:
<%@ page language="java" contentType="text/html;"%>

<html>
<body>
<%
String text = "This is from java code";
out.println(text);
%>
<hr>
<!--#include virtual="header.inc" -->
<hr>
This is page body.
</body>
</html>

--------------------------------------------------------------
Here is my /META-INF/context.xml

<?xml version="1.0" encoding="UTF-8"?>
<Context antiResourceLocking="false" privileged="true" />

--------------------------------------------------------------
and here is my /WEB-INF/web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="
http://java.sun.com/xml/ns/javaee" xmlns:web="
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID"
version="2.5">
  <display-name>MediaSearchArabic</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>

    <filter>
        <filter-name>ssi</filter-name>
        <filter-class>
          org.apache.catalina.ssi.SSIFilter
        </filter-class>
        <init-param>
          <param-name>contentType</param-name>
          <param-value>text/x-server-parsed-html(;.*)?</param-value>
        </init-param>
        <init-param>
          <param-name>debug</param-name>
          <param-value>0</param-value>
        </init-param>
        <init-param>
          <param-name>expires</param-name>
          <param-value>666</param-value>
        </init-param>
        <init-param>
          <param-name>isVirtualWebappRelative</param-name>
          <param-value>0</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>ssi</filter-name>
        <url-pattern>*</url-pattern>
    </filter-mapping>

</web-app>

---------------------------------------

I am attaching a sample web application that show the problem.

I greatly appreciate your support.


Regards,
Ahmed

Mime
View raw message