tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Todd Gamber" <>
Subject Tomcat 5.5 redirect vs. forward behavior with welcome-file-list
Date Mon, 12 Feb 2007 18:06:29 GMT
In Tomcat 4.1, a request to a directory containing a welcome-file would
*redirect* the user to a URL with any applicable welcome-file's name
appended. In Tomcat 5.5, the request is instead *forwarded* to the welcome

Is there a way to make Tomcat 5.5 act like Tomcat 4.1 in this respect?

For example:
I have a web.xml which contains:

In Tomcat 4.1, a request to makes the
browser refresh with a URL of

In Tomcat 5.5, the same request leaves the browser with the same URL

I'm using Tomcat 5.5.17 on Windows XP, and unfortunately, my application is
dependent on the redirect behavior of Tomcat 4.1 because my JSPs use
HttpServletRequest.getRequestURI() to find the name of the JSPs themselves.
The JSPs pull their content from the database based on the URL being
requested. So, if the browser's URL bar reads, the 'index.jsp' queries the DB
for content based on the path '/directory/index.jsp'. Conversely, if the
browser's URL bar reads, the same JSP looks
for database rows using the path '/directory/'. Naturally, because Tomcat
5.5 acts differently, similar requests receive different content.

I realize that populating content based on what's in the URL bar is not the
best design, but I can't seem to find another way to definitively get the
name of the actual JSP being requested. If anybody knows of a method similar
to getRequestURI(), but which knows the name of the JSP being requested, it
would help tremendously.


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message