Ok, I have found the problem. It is a result of an incorrectly written piece
of code in StandardContextMapper.map() under // Rule 3

I'm working on a rewrite that will parse things the way that they should be
parsed. :-) The issue is that the relativeURI variable can be pretty much
anything so it is difficult to figure out what the actual file suffix is out
of the path...

Some initial testing shows that the relativeURI variable could be any number
of bits of information...

uri: /Links.vm
uri: /Links.vm/foo/bar
uri: /Links.vm;foo/bar
uri: /Links.vm:foo/bar
uri: /Links.vm.foo/bar

So, what I'm going to do is start at the first "." and then attempt to
resolve each additional character in the URI after the period against the
context.findServletMapping() until a match is found or the end of the URI is
reached.

Something like (untested):

String dotToEnd = relativeURI.substring(relativeURI.indexOf('.'))
StringBuffer sb = new StringBuffer();
for (int i=0; i<dotToEnd .length(); i++)
{
    sb.append(dotToEnd.charAt(i));
    wrapper = (Wrapper) context.findChild(sb.toString());
    if (wrapper != null) {
        break;
    }    
}

Then, once I know the suffix, I will make everything following the suffix
PATH_INFO.

I should be protected against DOS attacks of really long URI's by the
limited length that Catalina will accept for URI's.

-jon

on 9/30/01 1:25 PM, "Jon Stevens" <[EMAIL PROTECTED]> wrote:

> I want to get confirmation that this is a valid url:
> 
> http://localhost:8080/examples/jsp/snp/snoop.jsp/foo
> 
> Where:
> 
> PATH_INFO=/foo
> 
> The error that I get right now is:
> 
> HTTP Status 404 - /jsp/snp/snoop.jsp/foo
> The requested resource (/jsp/snp/snoop.jsp/foo) is not available.
> 
> Please note that:
> 
> http://localhost:8080/context/servlet/Bar/foo
> 
> Works just fine. I don't see why it shouldn't also work with file extension
> mapping.
> 
> thanks,
> 
> -jon


-- 
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>

Reply via email to