users@jsr311.java.net

Re: Matching requests to subresource methods

From: Sergey Beryozkin <sergey.beryozkin_at_iona.com>
Date: Tue, 11 Mar 2008 14:05:57 -0000

Hi

I'd like to ask another question about it.

Consider this class

@Path("/")
public class RootResource {

   @PATH("foo")
   public Bar getLocator() {
   }

   @GET
   @PATH("foo")
   public Response getState() {
   }
}

> GET /foo

As per the Section 2.5.2.d, both getState() and getLocator() will be in the initial list of candidates.

I'm not quite sute what happens next, as far as 2.5.2.f is concerned.
I think for both methods the number of literal characters (in templates) and the number of capturing groups is the same, thus
getLocator() will be chosen simply because it goes first alphabetically, and then Bar will be further introspected.

Is it correct ?

Thanks, Sergey


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