Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6754

Determin Media Type in Response

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.7, 3.1.4
    • Fix Version/s: 3.1.5, 3.0.8, 3.2.0
    • Component/s: JAX-RS
    • Labels:
      None
    • Environment:

      Windows

    • Estimated Complexity:
      Unknown

      Description

      @GET
      @Path("text")
      @Produces(value = "text/*")
      public String geText()

      { return "text/* is ok"; }

      request Accept=text/*

      Per spec 3.8|2
      2. Gather the set of producible media types P:
      • If the method is annotated with @Produces, set P = fV (method)g where V (t) represents the
      values of @Produces on the specified target t.
      • Else if the class is annotated with @Produces, set P = fV (class)g.
      • Else set P = fV (writers)g where ‘writers’ is the set of MessageBodyWriter that support the
      class of the returned entity object.

      Check the resource method anno first then class anno, at last check writers.

      So the response code should be 406.

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              nbqyqx@163.com Neal Hu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: