I have defined a JaxRs resource (Restlet 2.0 RC4) with multiple methods for
distinct paths. The paths and methods have the following signature:

@Path("/{var_a}/test")
public MyTestRep getTestRep1(@PathParam("var_a") String var_a){}

@Path("/{var_a}/{var_b}")
public MyTestRep getTestRep2(@PathParam("var_a") String var_a,
@PathParam("var_b") String var_b){}

If I make a request for /foo/test, the method getTestRep2 is invoked instead
of getTestRep1. The order seems to be determined by the order of the methods
returned from java.lang.class.getMethods().

org.restlet.ext.jaxrs.internal.wrappers.ResourceClass:getMethodsForPath
doesn't seem to be matching for substring in the URI. With the current
logic, both the methods are returned as matches without an ordering of
methods for closest match and the 1st one in the list always seems to be
getting executed. The closer match should be returned at the top of the list
from the above method.

Sriram


-- 
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/JaxRs-routing-bug-tp5576500p5576500.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2665246

Reply via email to