users@jsr311.java.net

Re : Selecting between method candidates

From: Sergey Beryozkin <sergey.beryozkin_at_iona.com>
Date: Fri, 11 Jul 2008 10:28:55 +0100

Hi,

Yes, this should fix it. Unfortunately I won't be able to confirm reliably if doing this substitution for unlimited path expressions
won't have any side effects as the test coverage of scenarious relying on such expressions is limited :-) so to say in CXF at this
stage...It does look like it will fix both the inconsistensy issue (when handling requests with trailing '/') and the problem
arising in the edge case when '/' and '/{id}' path expressions are used...

Cheers, Sergey

----- Original Message -----
From: "Marc Hadley" <Marc.Hadley_at_Sun.COM>
To: <users_at_jsr311.dev.java.net>
Sent: Thursday, July 10, 2008 10:33 PM
Subject: Re: Re : Selecting between method candidates


I think there's an easy fix for this by substituting (.+?) for the
existing (.*?) in section 3.7.3 step 4. I don't have time right now to
test it so I'd be interested in any feedback before I get round to it
in the next couple of days. There may be other side effects though...

Marc.

On Jul 10, 2008, at 6:44 PM, Sergey Beryozkin wrote:

> Hi
>
> Using 0.9 spec….Consider this class
>
> @Path(“/”)
> public class ResourceClass {
>
> @GET
> @Path(“/foo”)
> Public String get1() {}
>
>
> @GET
> @Path(value=“/foo/{id}”, limited=false)
> Public String get2() {}
>
>
> }
>
> requests like ‘/foo/’ (note the trailing ‘/’) are matched against get2(). If get2() had a limited path expression then the
> request will be matched against get1()
> so there’s some inconsistency here – I suppose it may not too bad given that we have an unlimited path expression in this case ?
>
>
> Now, if we have
>
> @Path(“/”)
> public class ResourceClass {
>
> @GET
> Public String getAll() {}
>
>
> @GET
> @Path(value=“/{id}”, limited=false)
> Public String getId() {}
>
>
> }
>
> then ‘/’ request will match getId().
> Both getAll() and getId() match initially, but ‘sort in descending order using the number of capturing groups’ constraint
> selects getId(). Note it’s the same issue we’ve chatted before about, but that one was to do with using limited path
> expressions – it’s fixed now, this time it’s an unlimited path
> which is used.
>
> I’m wondering is there something which can be done to make sure getAll() is selected in this case ?
>
>
> Cheers, Sergey
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
For additional commands, e-mail: users-help_at_jsr311.dev.java.net
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland