Can someone comment on the message below please ?
Thanks, Sergey
----- Original Message -----
From: Sergey Beryozkin
To: users_at_jsr311.dev.java.net
Sent: Friday, May 09, 2008 3:02 PM
Subject: Re: Selecting between method candidates
Hi
I've read the latest spec and I did a bit of testing with CXF with regard to this specific scenario...
I'd like to start again and explain how I see the algorithm working...
Here's the sample class :
@Path("/{a}")
public class FooClass {
@GET
@Path("/")
public Bars listBars() {...}
@GET
@PATH("/{e}")
public Bar readBar() {...}
}
I've just added the @Path("/") to the listBars(). Lets assume that both methods support the same set of Produce/Consume mime types.
Request is : GET /1/
So we start from 3.7.1, selecting a resource class. When '/1/' is matched against a reg expression produced from @Path("/{a}"), the match is ok and the final matching group is '/'.
Next we move to 3.7.2.a which says that if U is either null (which would be the case if we has '/1' request) or '/' as in our case, we move on to 3.7.3.
This is a bit confusing to me as we haven't even done yet any match against resource methods of FooClass - shouldn't that be done at least once ?
In CXF, the 'at least' once match is actually done, seems like it does not break the algorithm, but I'm not sure. So during this match '/' is successfully matched against both listBars and readBars due with the help from corresponding reg expressions.
Here I'd like to ask : am I correct in assuming that the 'at least once' run through 3.7.2 should be attempted in this case ?
If yes, then it seems to me that the only criterias for choosing between listBars and readBar are those specified in 3.7.2.f and they all actually seem equal to me (source is the same - both are resource methods, numebr of capturing groups is the same - none, except perhaps for a number of literals after substitution is also the same - 1 for readBar, 0 for - listBar)
Is it correct or not ?
If not then all the selection needs to be done in 3.7.f.3 and I can not see there how listBar should be selected instead of readBar.
Can you please help to clarify it all for me ?
> Some example would be appreciated.
Literal characters means those not part of path parameters. So, e.g.
if the URI template is "foo.{ext}" then the literal characters are
"foo.". Is that clearer ?
Thanks, it is...
> Marc.
Cheers, Sergey
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland