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

MessageBodyReaderInterceptor does not trigger for POST requests with MultivaluedMap parameter

    XMLWordPrintable

Details

    Description

      When I POST to a method that has a MultivaluedMap parameter, my MessageBodyReaderInterceptor does not trigger. Example:

      @POST
      @Path("/role")
      @Produces({"application/json", "application/xml"})
      public List<MyObject> post(MultivaluedMap<String, String> formParams) {
          // dostuff
      }    
      

      However, if I only use a plain String as parameter, the MessageBodyReaderInterceptor triggers as expected. Example:

      @POST
      @Path("/roletest")
      @Produces({"application/json", "application/xml"})
      public List<MyObject> postWithoutMultivaluedMap(String formParams) {
          // dostuff
      }
      

      Also, I am unable to get the MessageBodyReaderInterceptor for any GET requests.

      The interceptor looks like this:

      @Provider
      @ServerInterceptor
      @Precedence("SECURITY")
      public class MyInterceptor implements MessageBodyReaderInterceptor {
      
          public Object read(MessageBodyReaderContext context) throws IOException, WebApplicationException {
              System.err.println("MyInterceptor.read()");
      
              return context.proceed();
          }
      }
      

      I have an example project for this issue at https://github.com/henrik242/resteasy-interceptor-demo

      This issue might be related to RESTEASY-568

      Attachments

        Issue Links

          Activity

            People

              weli@redhat.com Weinan Li
              henrik242_jira Henrik Aronsen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: