Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-982

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.0.0.ER6
    • 7.0.0.DR9
    • REST
    • None
    • 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.

      The issue is still present in version 3.0.9.

      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.

              thofman Tomas Hofman
              mkopecky@redhat.com Marek Kopecky
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: