jersey
  1. jersey
  2. JERSEY-1335

@Produces(MediaType.TEXT_PLAIN + "," + MediaType.TEXT_XML) is not parsable any longer

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0-m05
    • Fix Version/s: 2.0-m06, 2.0
    • Component/s: None
    • Labels:
      None

      Description

      javadoc to Produces says:

      Each entry may specify a single type or consist of a comma separated list of types. E.g. {"image/jpeg,image/gif", "image/png"}

      Suppose a resource method:

      public class Resource {
      	@Produces(MediaType.TEXT_PLAIN + "," + MediaType.TEXT_XML)
      	@Consumes(MediaType.TEXT_PLAIN + "," + MediaType.TEXT_XML)
      	public String plus(@Context HttpHeaders headers) {
      		return headers.getMediaType() == null ? "null" : headers.getMediaType()
      				.toString();
      	}
      }
      

      this makes the deployment throw an exception:

      WARNING: Error parsing media type 'text/plain,text/xml'

        Activity

        Hide
        Marek Potociar added a comment -

        This is obviously an implementation issue.

        Show
        Marek Potociar added a comment - This is obviously an implementation issue.

          People

          • Assignee:
            Marek Potociar
            Reporter:
            jan.supol
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 2 hours
              2h