Re: Before I file a bug report...

2001-09-30 Thread cmanolache

On Sun, 30 Sep 2001, Jon Stevens wrote:

> > Mmmm, I'm not too sure about all this.
> > The servlet spec seems to imply that the extension mapping is on the end of
> > the path.
> >
> > Section 11.1, item #3 : If the last segment in the URL path contains an
> > extension (e.g. .jsp), the servlet container will try to match a servlet
> > that handles requests for the extension.
> > An extension is defined as the part of the last segment after the last '.'
> > character.
> >
> > Remy
>
> I think the Servlet Spec is wrong then because HTTP says that anything after
> the extension mapping is PATH_INFO. It Is also inconsistent with the way
> that servlet path mapping works as well.

Well, I agree with Jon, but we had this whole discussion almost a year
ago, and the conclusion was that the HTTP spec is wrong and we should
follow the Servlet spec.

Older versions of tomcat supported path info on extension mapped servlets,
that was removed since it was considered a spec compliance bug.

Workaround - declare each page with exact mappings in web.xml.

Costin





Re: Before I file a bug report...

2001-09-30 Thread Remy Maucherat

> on 9/30/01 3:15 PM, "Remy Maucherat" <[EMAIL PROTECTED]> wrote:
>
> > Mmmm, I'm not too sure about all this.
> > The servlet spec seems to imply that the extension mapping is on the end
of
> > the path.
> >
> > Section 11.1, item #3 : If the last segment in the URL path contains an
> > extension (e.g. .jsp), the servlet container will try to match a servlet
> > that handles requests for the extension.
> > An extension is defined as the part of the last segment after the last
'.'
> > character.
> >
> > Remy
>
> I think the Servlet Spec is wrong then because HTTP says that anything
after
> the extension mapping is PATH_INFO. It Is also inconsistent with the way
> that servlet path mapping works as well.

We're supposed to implement path mapping the way it is specified in the
servlet API. So if I read the spec correctly, it says that /foo.jsp goes to
the *.jsp mapping, and /foo.jsp/bar goes to the default servlet, since here
/bar would be the last segment of the URI.

Remy




Re: Before I file a bug report...

2001-09-30 Thread Jon Stevens

on 9/30/01 3:15 PM, "Remy Maucherat" <[EMAIL PROTECTED]> wrote:

> Mmmm, I'm not too sure about all this.
> The servlet spec seems to imply that the extension mapping is on the end of
> the path.
> 
> Section 11.1, item #3 : If the last segment in the URL path contains an
> extension (e.g. .jsp), the servlet container will try to match a servlet
> that handles requests for the extension.
> An extension is defined as the part of the last segment after the last '.'
> character.
> 
> Remy

I think the Servlet Spec is wrong then because HTTP says that anything after
the extension mapping is PATH_INFO. It Is also inconsistent with the way
that servlet path mapping works as well.

-jon




Re: Before I file a bug report...

2001-09-30 Thread Remy Maucherat

> 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.

Mmmm, I'm not too sure about all this.
The servlet spec seems to imply that the extension mapping is on the end of
the path.

Section 11.1, item #3 : If the last segment in the URL path contains an
extension (e.g. .jsp), the servlet container will try to match a servlet
that handles requests for the extension.
An extension is defined as the part of the last segment after the last '.'
character.

Remy




Re: Before I file a bug report...

2001-09-30 Thread Jon Stevens

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 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





Before I file a bug report...

2001-09-30 Thread Jon Stevens

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