[jetty-users] Bug in PathMap

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[jetty-users] Bug in PathMap

Nils Kilden-Pedersen-2

I think.

Got hit with a StringIndexOutOfBounds something.

Tracked it to line 404 (yeah, really) in PathMap:

char c = pathSpec.charAt(0);

Since Servlet spec 3.0, empty strings "" matches on the context root. I had a filter defined with urlPatterns={""}.

I can‘t quite figure out the validity of matching filters to context root, since I’ve seen similar reports from WebSphere and Glassfish, but regardless, the error message should be better then.

Nils


_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-users] Bug in PathMap

Joakim Erdfelt-9
That is a bug, and should be fixed.

However, Servlet Spec 3.1 pretty much banned "" as a path spec (stating it as a mistake of past specs) and now enforces the use of "/".
If you haven't updated your code yet to use "/", you should stick with Jetty 7/8, as Jetty 9 is going to be Servlet Spec 3.1 moving forward.

--
Joakim Erdfelt <[hidden email]>
Expert advice, services and support from from the Jetty & CometD experts


On Sat, Sep 7, 2013 at 12:38 PM, Nils Kilden-Pedersen <[hidden email]> wrote:

I think.

Got hit with a StringIndexOutOfBounds something.

Tracked it to line 404 (yeah, really) in PathMap:

char c = pathSpec.charAt(0);

Since Servlet spec 3.0, empty strings "" matches on the context root. I had a filter defined with urlPatterns={""}.

I can‘t quite figure out the validity of matching filters to context root, since I’ve seen similar reports from WebSphere and Glassfish, but regardless, the error message should be better then.

Nils


_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-users] Bug in PathMap

Joakim Erdfelt-9
Opened up bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=416787

This code has been like this since the implementation of Servlet Spec 2.2 (I have no history earlier than that).
Attached a patch to the bug for our spec leads to validate.

--
Joakim Erdfelt <[hidden email]>
Expert advice, services and support from from the Jetty & CometD experts


On Sat, Sep 7, 2013 at 4:49 PM, Joakim Erdfelt <[hidden email]> wrote:
That is a bug, and should be fixed.

However, Servlet Spec 3.1 pretty much banned "" as a path spec (stating it as a mistake of past specs) and now enforces the use of "/".
If you haven't updated your code yet to use "/", you should stick with Jetty 7/8, as Jetty 9 is going to be Servlet Spec 3.1 moving forward.

--
Joakim Erdfelt <[hidden email]>
Expert advice, services and support from from the Jetty & CometD experts


On Sat, Sep 7, 2013 at 12:38 PM, Nils Kilden-Pedersen <[hidden email]> wrote:

I think.

Got hit with a StringIndexOutOfBounds something.

Tracked it to line 404 (yeah, really) in PathMap:

char c = pathSpec.charAt(0);

Since Servlet spec 3.0, empty strings "" matches on the context root. I had a filter defined with urlPatterns={""}.

I can‘t quite figure out the validity of matching filters to context root, since I’ve seen similar reports from WebSphere and Glassfish, but regardless, the error message should be better then.

Nils


_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users




_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-users] Bug in PathMap

Nils Kilden-Pedersen-2
In reply to this post by Joakim Erdfelt-9
On Sat, Sep 7, 2013 at 6:49 PM, Joakim Erdfelt <[hidden email]> wrote:
That is a bug, and should be fixed.

However, Servlet Spec 3.1 pretty much banned "" as a path spec (stating it as a mistake of past specs) and now enforces the use of "/".

That's interesting, considering the "" context root addition (clarification?) wasn't added until the 3.0 spec, where "" maps exactly to the context root and "/" maps to the default servlet. Has this been changed? In other words, how is that distinction made in 3.1?
 
If you haven't updated your code yet to use "/", you should stick with Jetty 7/8, as Jetty 9 is going to be Servlet Spec 3.1 moving forward.

I'm not live yet, building on 9. So I'm really waiting for 9.1 to be released.
 

--
Joakim Erdfelt <[hidden email]>
Expert advice, services and support from from the Jetty & CometD experts


On Sat, Sep 7, 2013 at 12:38 PM, Nils Kilden-Pedersen <[hidden email]> wrote:

I think.

Got hit with a StringIndexOutOfBounds something.

Tracked it to line 404 (yeah, really) in PathMap:

char c = pathSpec.charAt(0);

Since Servlet spec 3.0, empty strings "" matches on the context root. I had a filter defined with urlPatterns={""}.

I can‘t quite figure out the validity of matching filters to context root, since I’ve seen similar reports from WebSphere and Glassfish, but regardless, the error message should be better then.

Nils


_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-users] Bug in PathMap

Nils Kilden-Pedersen-2

On Sat, Sep 7, 2013 at 8:54 PM, Nils Kilden-Pedersen <[hidden email]> wrote:

On Sat, Sep 7, 2013 at 6:49 PM, Joakim Erdfelt <[hidden email]> wrote:
That is a bug, and should be fixed.

However, Servlet Spec 3.1 pretty much banned "" as a path spec (stating it as a mistake of past specs) and now enforces the use of "/".

That's interesting, considering the "" context root addition (clarification?) wasn't added until the 3.0 spec, where "" maps exactly to the context root and "/" maps to the default servlet. Has this been changed? In other words, how is that distinction made in 3.1?

I did the obvious thing and check the 3.1 spec, which states the exact same thing as 3.0. From section 12.2:

The empty string (“”) is a special URL pattern that exactly maps to the application's context root, i.e., requests of the form <a href="http://host:port/">http://host:port//. In this case the path info is ’/’ and the servlet path and context path is empty string (““).

I don't see any indication that "" is banned as a path spec?

 
If you haven't updated your code yet to use "/", you should stick with Jetty 7/8, as Jetty 9 is going to be Servlet Spec 3.1 moving forward.

I'm not live yet, building on 9. So I'm really waiting for 9.1 to be released.
 

--
Joakim Erdfelt <[hidden email]>
Expert advice, services and support from from the Jetty & CometD experts


On Sat, Sep 7, 2013 at 12:38 PM, Nils Kilden-Pedersen <[hidden email]> wrote:

I think.

Got hit with a StringIndexOutOfBounds something.

Tracked it to line 404 (yeah, really) in PathMap:

char c = pathSpec.charAt(0);

Since Servlet spec 3.0, empty strings "" matches on the context root. I had a filter defined with urlPatterns={""}.

I can‘t quite figure out the validity of matching filters to context root, since I’ve seen similar reports from WebSphere and Glassfish, but regardless, the error message should be better then.

Nils


_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-users] Bug in PathMap

Jan Bartel-3
Nils,

I fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=416787. Yes, you
can have "" as the url mapping for a servlet or filter from servlet
spec 3.0 onwards.

cheers
Jan

On 8 September 2013 11:58, Nils Kilden-Pedersen
<[hidden email]> wrote:

> On Sat, Sep 7, 2013 at 8:54 PM, Nils Kilden-Pedersen
> <[hidden email]> wrote:
>>
>> On Sat, Sep 7, 2013 at 6:49 PM, Joakim Erdfelt <[hidden email]> wrote:
>>>
>>> That is a bug, and should be fixed.
>>>
>>> However, Servlet Spec 3.1 pretty much banned "" as a path spec (stating
>>> it as a mistake of past specs) and now enforces the use of "/".
>>
>>
>> That's interesting, considering the "" context root addition
>> (clarification?) wasn't added until the 3.0 spec, where "" maps exactly to
>> the context root and "/" maps to the default servlet. Has this been changed?
>> In other words, how is that distinction made in 3.1?
>
> I did the obvious thing and check the 3.1 spec, which states the exact same
> thing as 3.0. From section 12.2:
>
> The empty string (“”) is a special URL pattern that exactly maps to the
> application's context root, i.e., requests of the form <a href="http://host:port//">http://host:port//.
> In this case the path info is ’/’ and the servlet path and context path is
> empty string (““).
>
> I don't see any indication that "" is banned as a path spec?
>>
>>
>>>
>>> If you haven't updated your code yet to use "/", you should stick with
>>> Jetty 7/8, as Jetty 9 is going to be Servlet Spec 3.1 moving forward.
>>
>>
>> I'm not live yet, building on 9. So I'm really waiting for 9.1 to be
>> released.
>>
>>>
>>>
>>> --
>>> Joakim Erdfelt <[hidden email]>
>>> webtide.com - intalio.com/jetty
>>> Expert advice, services and support from from the Jetty & CometD experts
>>> eclipse.org/jetty - cometd.org
>>>
>>>
>>> On Sat, Sep 7, 2013 at 12:38 PM, Nils Kilden-Pedersen
>>> <[hidden email]> wrote:
>>>>
>>>> I think.
>>>>
>>>> Got hit with a StringIndexOutOfBounds something.
>>>>
>>>> Tracked it to line 404 (yeah, really) in PathMap:
>>>>
>>>> char c = pathSpec.charAt(0);
>>>>
>>>> Since Servlet spec 3.0, empty strings "" matches on the context root. I
>>>> had a filter defined with urlPatterns={""}.
>>>>
>>>> I can‘t quite figure out the validity of matching filters to context
>>>> root, since I’ve seen similar reports from WebSphere and Glassfish, but
>>>> regardless, the error message should be better then.
>>>>
>>>> Nils
>>>>
>>>>
>>>> _______________________________________________
>>>> jetty-users mailing list
>>>> [hidden email]
>>>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>>>
>>>
>>>
>>> _______________________________________________
>>> jetty-users mailing list
>>> [hidden email]
>>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>>
>>
>
> _______________________________________________
> jetty-users mailing list
> [hidden email]
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>



--
Jan Bartel <[hidden email]>
www.webtide.com
'Expert Jetty/CometD developer,production,operations advice'
_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-users] Bug in PathMap

Nils Kilden-Pedersen-2
Thanks.

Will that be in 9.0.6?


On Sun, Sep 8, 2013 at 9:51 PM, Jan Bartel <[hidden email]> wrote:
Nils,

I fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=416787. Yes, you
can have "" as the url mapping for a servlet or filter from servlet
spec 3.0 onwards.

cheers
Jan

On 8 September 2013 11:58, Nils Kilden-Pedersen
<[hidden email]> wrote:
> On Sat, Sep 7, 2013 at 8:54 PM, Nils Kilden-Pedersen
> <[hidden email]> wrote:
>>
>> On Sat, Sep 7, 2013 at 6:49 PM, Joakim Erdfelt <[hidden email]> wrote:
>>>
>>> That is a bug, and should be fixed.
>>>
>>> However, Servlet Spec 3.1 pretty much banned "" as a path spec (stating
>>> it as a mistake of past specs) and now enforces the use of "/".
>>
>>
>> That's interesting, considering the "" context root addition
>> (clarification?) wasn't added until the 3.0 spec, where "" maps exactly to
>> the context root and "/" maps to the default servlet. Has this been changed?
>> In other words, how is that distinction made in 3.1?
>
> I did the obvious thing and check the 3.1 spec, which states the exact same
> thing as 3.0. From section 12.2:
>
> The empty string (“”) is a special URL pattern that exactly maps to the
> application's context root, i.e., requests of the form http://host:port//.
> In this case the path info is ’/’ and the servlet path and context path is
> empty string (““).
>
> I don't see any indication that "" is banned as a path spec?
>>
>>
>>>
>>> If you haven't updated your code yet to use "/", you should stick with
>>> Jetty 7/8, as Jetty 9 is going to be Servlet Spec 3.1 moving forward.
>>
>>
>> I'm not live yet, building on 9. So I'm really waiting for 9.1 to be
>> released.
>>
>>>
>>>
>>> --
>>> Joakim Erdfelt <[hidden email]>
>>> webtide.com - intalio.com/jetty
>>> Expert advice, services and support from from the Jetty & CometD experts
>>> eclipse.org/jetty - cometd.org
>>>
>>>
>>> On Sat, Sep 7, 2013 at 12:38 PM, Nils Kilden-Pedersen
>>> <[hidden email]> wrote:
>>>>
>>>> I think.
>>>>
>>>> Got hit with a StringIndexOutOfBounds something.
>>>>
>>>> Tracked it to line 404 (yeah, really) in PathMap:
>>>>
>>>> char c = pathSpec.charAt(0);
>>>>
>>>> Since Servlet spec 3.0, empty strings "" matches on the context root. I
>>>> had a filter defined with urlPatterns={""}.
>>>>
>>>> I can‘t quite figure out the validity of matching filters to context
>>>> root, since I’ve seen similar reports from WebSphere and Glassfish, but
>>>> regardless, the error message should be better then.
>>>>
>>>> Nils
>>>>
>>>>
>>>> _______________________________________________
>>>> jetty-users mailing list
>>>> [hidden email]
>>>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>>>
>>>
>>>
>>> _______________________________________________
>>> jetty-users mailing list
>>> [hidden email]
>>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>>
>>
>
> _______________________________________________
> jetty-users mailing list
> [hidden email]
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>



--
Jan Bartel <[hidden email]>
www.webtide.com
'Expert Jetty/CometD developer,production,operations advice'


_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-users] Bug in PathMap

Jan Bartel-3
Yep.

Jan

On 11 September 2013 10:06, Nils Kilden-Pedersen
<[hidden email]> wrote:

> Thanks.
>
> Will that be in 9.0.6?
>
>
> On Sun, Sep 8, 2013 at 9:51 PM, Jan Bartel <[hidden email]> wrote:
>>
>> Nils,
>>
>> I fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=416787. Yes, you
>> can have "" as the url mapping for a servlet or filter from servlet
>> spec 3.0 onwards.
>>
>> cheers
>> Jan
>>
>> On 8 September 2013 11:58, Nils Kilden-Pedersen
>> <[hidden email]> wrote:
>> > On Sat, Sep 7, 2013 at 8:54 PM, Nils Kilden-Pedersen
>> > <[hidden email]> wrote:
>> >>
>> >> On Sat, Sep 7, 2013 at 6:49 PM, Joakim Erdfelt <[hidden email]>
>> >> wrote:
>> >>>
>> >>> That is a bug, and should be fixed.
>> >>>
>> >>> However, Servlet Spec 3.1 pretty much banned "" as a path spec
>> >>> (stating
>> >>> it as a mistake of past specs) and now enforces the use of "/".
>> >>
>> >>
>> >> That's interesting, considering the "" context root addition
>> >> (clarification?) wasn't added until the 3.0 spec, where "" maps exactly
>> >> to
>> >> the context root and "/" maps to the default servlet. Has this been
>> >> changed?
>> >> In other words, how is that distinction made in 3.1?
>> >
>> > I did the obvious thing and check the 3.1 spec, which states the exact
>> > same
>> > thing as 3.0. From section 12.2:
>> >
>> > The empty string (“”) is a special URL pattern that exactly maps to the
>> > application's context root, i.e., requests of the form
>> > <a href="http://host:port//">http://host:port//.
>> > In this case the path info is ’/’ and the servlet path and context path
>> > is
>> > empty string (““).
>> >
>> > I don't see any indication that "" is banned as a path spec?
>> >>
>> >>
>> >>>
>> >>> If you haven't updated your code yet to use "/", you should stick with
>> >>> Jetty 7/8, as Jetty 9 is going to be Servlet Spec 3.1 moving forward.
>> >>
>> >>
>> >> I'm not live yet, building on 9. So I'm really waiting for 9.1 to be
>> >> released.
>> >>
>> >>>
>> >>>
>> >>> --
>> >>> Joakim Erdfelt <[hidden email]>
>> >>> webtide.com - intalio.com/jetty
>> >>> Expert advice, services and support from from the Jetty & CometD
>> >>> experts
>> >>> eclipse.org/jetty - cometd.org
>> >>>
>> >>>
>> >>> On Sat, Sep 7, 2013 at 12:38 PM, Nils Kilden-Pedersen
>> >>> <[hidden email]> wrote:
>> >>>>
>> >>>> I think.
>> >>>>
>> >>>> Got hit with a StringIndexOutOfBounds something.
>> >>>>
>> >>>> Tracked it to line 404 (yeah, really) in PathMap:
>> >>>>
>> >>>> char c = pathSpec.charAt(0);
>> >>>>
>> >>>> Since Servlet spec 3.0, empty strings "" matches on the context root.
>> >>>> I
>> >>>> had a filter defined with urlPatterns={""}.
>> >>>>
>> >>>> I can‘t quite figure out the validity of matching filters to context
>> >>>> root, since I’ve seen similar reports from WebSphere and Glassfish,
>> >>>> but
>> >>>> regardless, the error message should be better then.
>> >>>>
>> >>>> Nils
>> >>>>
>> >>>>
>> >>>> _______________________________________________
>> >>>> jetty-users mailing list
>> >>>> [hidden email]
>> >>>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>> >>>>
>> >>>
>> >>>
>> >>> _______________________________________________
>> >>> jetty-users mailing list
>> >>> [hidden email]
>> >>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>> >>>
>> >>
>> >
>> > _______________________________________________
>> > jetty-users mailing list
>> > [hidden email]
>> > https://dev.eclipse.org/mailman/listinfo/jetty-users
>> >
>>
>>
>>
>> --
>> Jan Bartel <[hidden email]>
>> www.webtide.com
>> 'Expert Jetty/CometD developer,production,operations advice'
>
>



--
Jan Bartel <[hidden email]>
www.webtide.com
'Expert Jetty/CometD developer,production,operations advice'
_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users