tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Morrissey <davemorris...@gmail.com>
Subject Possible bug in servlet mapping - versions later than 5.5.12
Date Tue, 02 May 2006 19:19:13 GMT
Hello,

I'm looking for some advice on whether to post what appears to be a bug 
in the Tomcat BugZilla. I found this in v5.5.17, reproduced it in 
v5.5.16, and haven't been able to reproduce it in v5.5.12 or earlier.

I have a Struts application with mappings for files in the root folder 
and in various subfolders. It appears that requests for any (virtual) 
file in any subfolder is not being passed through to the Struts 
ActionServlet, instead Tomcat is looking in the appropriate place on the 
file system for a file named (for example) "/subfolder/page.do", and 
returning a 404 error. Requests for pages in the root (e.g. "/page.do") 
work normally. This only happens when I am accessing the application 
using a domain name that is mapped to a Host element other than the 
default localhost.

Steps to reproduce:

1. Add an entry in your hosts file to map a domain name to your local 
machine (e.g. www.mytestdomain.com)
2. Download and unzip the Tomcat 5.5.17 binary distribution 
(apache-tomcat-5.5.17.zip) from 
http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.17/bin/
3. Download Struts 1.2.9 (struts-1.2.9-bin.zip) from 
http://svn.apache.org/dist/struts/v1.2.9/ and copy struts-examples.war 
into Tomcat's webapps folder
4. Add the following lines after the </Host> line in conf/server.xml:
            <Host name="www.mytestdomain.com" debug="0" 
appBase="webapps\struts-examples"
                unpackWARs="true" autoDeploy="true">
                <Context path="" docBase="" debug="0"/>
            </Host>
5. Start Tomcat using startup.bat
6. Browse to http://localhost:8080/struts-examples/ and click Taglib 
Test Pages. A list of tag names should be returned.
7. Browse to http://www.mytestdomain.com:8080/ and click Taglib Test 
Pages. A 404 (/exercise/welcome.do) should be returned. Note the root 
/welcome.do is served normally.

(Test machine: Win XP SP2, JDK1.5)

I've used the struts-examples webapp to demonstrate this for simplicity. 
I have found the same with my own applications.

Has anyone else experienced this problem, and should it be logged in 
BugZilla? My apologies if this bug has appeared before or is not a bug 
at all!

Kind regards,
Dave Morrissey

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message