[jax-rs-spec users] [jsr339-experts] Re: Corner case in URI matching

From: Markus KARG <>
Date: Tue, 25 Feb 2014 18:28:51 +0100

Actually I would have assumed that the semicolon is detected as an
end-of-path separator, hence getPerson to be matched for the second case.

-----Original Message-----
From: Sergey Beryozkin []
Sent: Dienstag, 25. Februar 2014 14:42
Subject: [jsr339-experts] Corner case in URI matching

Hi All, how are things,

I've just had to deal with what appears to be a corner case in the way URI
is matched:

public class Root {
     public Response getAll() {...}

     public Response getPerson(@PathParam("id") long id) {...}


GET /people;a=b

selects getAll()

GET /people/;a=b

selects Root and "/;a=b" is used to match the method, both getAll &
getPerson match it, getPerson is preferred, catches ";a=b" as a template
parameter value, the exception is thrown when converting it to long.

Restricting getPerson to "@Path("/{id:(\d)+}/")" fixes the problem.

Is there any reason the specification can not require that ";" is explicitly
forbidden in the default expression matching a given template var such as
"{id}" ?