users@jsr311.java.net

Selecting between method candidates

From: Sergey Beryozkin <sergey.beryozkin_at_iona.com>
Date: Tue, 6 May 2008 18:37:20 +0100

Hi,

I have one question with respect to selecting between multiple methods ...

Consider this class :

@Path("{a}/{b}/{c}/d")
public class FooClass {

@GET
public Bars listBars() {
    return bars;
}

@GET
@PATH("/{e}")
public Bar readBar() {
    return bar;
}
}

In CXF a request like URI /1/2/3/4 is delegated to readBar() but the user is expecting listBars be invoked and I'm wondering, where exacly CXF fails to follow the spec...
Both methods match the request and both methods are added to the list.

In both cases the number of capturing groups is 3, the source is different (readBar is a resource method, listBars is a locator).

Is the users's expectation is correct that listBars() should be invoked. If yes, what piece of teh JAX-RS specification says why in this case listBars() needs to be invoked ?

Many thanks, Sergey




----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland