JAX-RS @PathParam How to pass a String with slashes, hyphens & equals too

后端 未结 5 1706
北荒
北荒 2020-12-14 14:36

I am new to JAX-RS and I am trying to use Jersey to build a simple RESTful Webservice.

I have 2 questions. Please clarify these:

  1. I am trying to have

5条回答
  •  自闭症患者
    2020-12-14 15:15

    The following should work:

    @GET
    @Path("{inchiname : (.+)?}")
    @Produces("application/xml")
    public String get3DCoordinates(@PathParam("inchiname")String inchiName) {
    

    (This is sort of mentioned in another answer and comment, I'm just explicitly putting it in a separate answer to make it clear)

提交回复
热议问题