Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2845

ResteasyWebTarget.proxy(Class) problem with questionmark in @Path with Regex

XMLWordPrintable

    • Hide

      Create Interface with a Method as Follows:

      @GET
      {{ @Path("/

      {name}

      /

      {search:[a-z]?}

      ")}}
      {{ @Produces(MediaType.APPLICATION_XML)}}
      {{ Response searchEntities(@ResourceName @PathParam("name") String name,}}
      {{ @PathParam("search") @Encoded String searchString);}}

       

      Create a Proxy-Implementation via ResteasyWebTarget.proxy(Class)

      Call the Method.

      Check the URL which is called. Will be something like

      ...\name%7Bsearch:%5Ba-z%5D?%7D

      Show
      Create Interface with a Method as Follows: @GET {{ @Path("/ {name} / {search:[a-z]?} ")}} {{ @Produces(MediaType.APPLICATION_XML)}} {{ Response searchEntities(@ResourceName @PathParam("name") String name,}} {{ @PathParam("search") @Encoded String searchString);}}   Create a Proxy-Implementation via ResteasyWebTarget.proxy(Class) Call the Method. Check the URL which is called. Will be something like ...\name%7Bsearch:%5Ba-z%5D?%7D
    • Workaround Exists
    • Hide

      Replace Questionmark with {0,1}:

      @GET
      @Path("/{name}/{search:[a-z]{0,1}}")
      @Produces(MediaType.APPLICATION_XML)
      Response searchEntities(@ResourceName @PathParam("name") String name,
      @PathParam("search") @Encoded String searchString);

      Show
      Replace Questionmark with {0,1}: @GET @Path("/{name}/{search: [a-z] {0,1}}") @Produces(MediaType.APPLICATION_XML) Response searchEntities(@ResourceName @PathParam("name") String name, @PathParam("search") @Encoded String searchString);
    • Undefined

      A Client-Proxy createt via ResteasyWebTarget.proxy(Class) uses a wrong URL when there is a questionmark in a regex in the Path-Annotation of a Method. The old ProxyFactory.create(...) worked fine with the same Regex.

            Unassigned Unassigned
            azoike Andreas Zoike (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: