admin管理员组

文章数量:1333450

I have a simple api

@GET
@Path("res/{res-path :.*}")
public Response getRes(@PathParam("res-path") String resource) {

   System.out.println(resource);
}

I was under impression that this should capture anything after res/ into resource but it is not the case !

URL : res/res2 -----> Prints res2 (accepted)

URL : res/res2/res3 -----> Prints res2/res3 (accepted)

BUT

URL : res/res -----> Prints EMPTY STRING (instead of res/)

URL : res/res/res2 -----> Prints res2 (instead of res/res2)

Any suggestions or thoughts?

本文标签: jax rsJAXRS uri template not capturing expected stringStack Overflow