I'm trying to use a path like this, with the last parameter optional, so that if it's present it's used, otherwise it's simply set to null or empty.
@Path("/create/{param1}{param2:(/param2/[^/]+?)?}")
However I get a 200 when the first static parameter is set, but i get a 404 (not found) when the second option parameter is set as well.
For example, this fails with a 404:
http://hostname/create/abc1/abc2
and this succeeds with a 200:
http://hostname/create/abc1
What am I doing wrong with that optional path that Jersey can't match it?