最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

jax rs - JAX-RS uri template not capturing expected string - Stack Overflow

programmeradmin0浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论