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

@FormParam does not work with PUT method when a Query param is present

    XMLWordPrintable

Details

    • Hide

      Create a PUT method with @FormParam

       
      @PUT
      @Path("/api/{pathparam:\\d+}")
      @Consumes("application/x-www-form-urlencoded")
      @Produces({"application/xml", "application/json"})
      public void updateGuestPostStatus(	@PathParam("pathparam") Long pathparam, 
      					@FormParam("formParam") String formParam)
      

      And call the URL with a query param as well as the form param. The form param won't be retrieved.

      Show
      Create a PUT method with @FormParam @PUT @Path( "/api/{pathparam:\\d+}" ) @Consumes( "application/x-www-form-urlencoded" ) @Produces({ "application/xml" , "application/json" }) public void updateGuestPostStatus( @PathParam( "pathparam" ) Long pathparam, @FormParam( "formParam" ) String formParam) And call the URL with a query param as well as the form param. The form param won't be retrieved.

    Description

      I have the following method in my code

       
      @PUT
      @Path("/api/{pathparam:\\d+}")
      @Consumes("application/x-www-form-urlencoded")
      @Produces({"application/xml", "application/json"})
      public void updateGuestPostStatus(	@PathParam("pathparam") Long pathparam, 
      					@FormParam("formParam") String formParam)
      

      When calling PUT /api/100000588600
      With content type application/x-www-form-urlencoded
      And content

      formParam=PRESENT

      It works well, I have the variable formParam set..

      But when I call PUT /api/100000588600?something
      with the same content

      The variable formParam is null.

      This did not use to happen with Resteasy 2.0.1.GA.

      Actually, this is this code change which broke the behavior:
      https://github.com/resteasy/Resteasy/commit/bc78212fa2744df72d82b0a025bc1b7dcb97aeb7

      Since the request's parameterMap is not empty, it does not load the form parameters.

      Is there a right reason to not allow FormParm on PUT method call on an URL with query parameters ?

      Thank you.

      Attachments

        Issue Links

          Activity

            People

              rsigal@redhat.com Ronald Sigal
              guinotphil Philippe Guinot (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: