tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TiGRETON <>
Subject JSP Include directive problem when upgrading to Tomcat 5.5
Date Mon, 10 Apr 2006 14:10:56 GMT

We are moving from Tomcat 5.0.28 to Tomcat 5.5.16, and we found that JSP
<%@ include %> directives fail when the path contains a call to a file
placed in the parent (..) directory.

AFAIK Tomcat is creating a separate context for JSP files in the /admin/
directory. How can I disable this behavior?

This is our server.xml file. We replaced the original one with this
trimmed version. We only use AJP (which works fine), and as we have
several tomcats running on the same server we changed the port numbers

<Server port="46007" shutdown="SHUTDOWN">

  <Service name="Catalina-Service-DG-46006">

    <Connector address="" allowTrace="false"
      enableLookups="false" maxPostSize="2097152"
      scheme="http" secure="false" port="46006" protocol="AJP/1.3" />

    <Engine name="Catalina-Engine-DG-46006" defaultHost="localhost">

      <Host name="localhost"
        appBase="/var/www/html/" autoDeploy="false">

        <Context path="/" docBase="" cookies="true" />

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

- --[/var/www/html/]-----------------------------------
<% out.write("<h2>foo</h2>"); %>
- ------------------------------------------------------------------------

- --[/var/www/html/]-----------------------------
<% out.write("<h1>Bar</h1>"); %>
<%@ include file="../foo.jsp" %>
- ------------------------------------------------------------------------

- --[Error when calling]------------------------
org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /bar.jsp(2,0) File "/../foo.jsp" not
- ------------------------------------------------------------------------


Iván Montoro

P.S. Sorry if this is covered in any FAQ, but I've searched the mailing
list archives, google'd and read the Tomcat docs without clue...

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message