users@jsr311.java.net

Re : Selecting between method candidates

From: Sergey Beryozkin <sergey.beryozkin_at_iona.com>
Date: Thu, 10 Jul 2008 17:44:23 +0100

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