tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jack Eidsness <>
Subject web.xml servlet mappings, url pattern and CGI.PATH_INFO (tomcat 4.1.31)
Date Mon, 03 Jan 2005 21:09:01 GMT
I am new to the J2EE world, so hopefully I will not use terms incorrectly.

Due to circumstances beyond my control, coldfusion has been retrofitted 
into a J2EE web application and I have recently taken on the task of 
trying to make previously existing cfm code work as part of a tomcat 
installation.   I have found (so far) only one thing that doesn't work 
like it used to, and its a significant problem for me.

CGI apps can have a false path appended after the script name, which is 
written into the CGI.PATH_INFO variable, so that it can be available to 
scripts.  It would seem that tomcat is less flexible than apache httpd 
about when this information will be supplied.  At least, jakarta-tomcat 
4.1.31 doesn't want to play ball.  I have not yet experimented with 
version 5.x.

I have found a lot of discussion of this matter, but no conclusive 
answer as to what the workaround is, nor, as i fear, that there is no 
viable workaround.

By default, my coldfusion war file came with this in the web.xml:

       <servlet-mapping id="macromedia_mapping_3">

attempting to browse (via the coyote thingie) to
will bring up the right page, but
this gets me a 404.

So far, I have only found one way to make tomcat give me the correct 
If I do this:
then I will be able to run the right script and CGI.PATH_INFO is set to 

Naturally, if you have more than a couple situations where you use 
PATH_INFO, this configuration becomes quickly unmanageable, and 
unreasonable.  ("grep -iRl path_info ." will only get me so far)

Is there a way to make this work without naming every cfm file that 
might use PATH_INFO in the web.xml?

For anyone interested in helping, here are some things that I have tried 
that did not work (in each case, I have tried it as a replacement, 
breaking the normal way it works for possible experimental value, or as 
an additional servlet-mapping):

If I do this:
I get an error in the jakarta logs when the web.xml is read;

java.lang.IllegalArgumentException: Invalid <url-pattern> *.cfm/* in 
servlet mapping

I looked up the source code and it says you can't start a servlet 
mapping's url-pattern with "*." and have a "/" in the pattern at once. :/

If I do this (nevermind that its not exactly what I want):
Then the second * is not expanded as a wildcard. i.e. a file named 
"index.cfm*" (literal '*' character) could be processed as a cfm file.

If I do this
I get a 404.

Thanks in advance for any time that any of you spend considering this issue,

Jack Eidsness

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

View raw message