tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arlene Milgram" <Arlene.Milg...@MEDecision.com>
Subject Context Relative versus Path Relative error pages
Date Wed, 12 Oct 2005 19:35:18 GMT
Hi All,

We ran into a problem with JSP pages under Tomcat 5.5.9 which did not
exist under Tomcat 4.1.31.

In Tomcat 5.5.9 if we forward to a JSP page that is in a different
directory then the initial request the errorPage directive does not work
as we expected.

If we use a path relative errorPage directive then Tomcat 5.5.9 seems to
assume that the errorPage path is relative to the path of the initial
HTTP request not the JSP page.  Is this behavior correct?

For example, Error 404, /servlet/PopError.jsp appears if an HTTP request
of /servlet/PathServ forwards to a JSP page, /popdrv/pathRelative.jsp,
that uses relative paths and then throws an exception.

	<%@ page language="java"
	    session="true"
	    errorPage="PopError.jsp"
	%>

We found a similar entry in BugZilla which was closed because the
problem could not be reproduced.

http://issues.eu.apache.org/bugzilla/show_bug.cgi?id=35230

One can get the correct errorPage by using a Context relative path.

	<%@ page language="java"
	    session="true"
	    errorPage="/popdrv/PopError.jsp"
	%>

We have attached 6 files, PathServ.java, pathRelative.jsp,
ContextServ.java, contextRelative.jsp, PopError.jsp, and web.xml.  To
see the issue one can create a context and place PathServ.java in the
directory com.optimedsys.servlet, pathRelative.jsp and PopError.jsp in
the directory popdrv.   To see the workaround one can place
ContextServ.java in the directory com.optimedsys.servlet,
contextRelative.jsp and PopError.jsp in the popdrv directory.

Request "context/servlet/PathServ" to see the 404 error or
"context/servlet/ContextServ" to get the correct errorPage.

Thank You

Lee Breslow
lee.breslow@MEDecision.com

Arlene Milgram
arlene.milgram@MEDecision.com

Mime
View raw message