Re: JSR311: Provider mime type matching

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 05 Sep 2008 13:00:28 -0400

On Sep 5, 2008, at 12:41 PM, Stephan Koops wrote:
> I think it's too late for the spec, but you could implement it out
> of the specification, as I also do. My JAXB provider supports
> @Produces( { "application/xml", "text/xml", "application/*+xml" })
> (and also @Consumes)
The spec (section 4.2.4) requires a standard entity provider for:

"javax.xml.bind.JAXBElement and application-supplied JAXB classes for
XML media types (text/xml, application/xml and application/*+xml)."

So if you have a method like this:

public SomeType someMethod(SomeJAXBBean bean) {...}

then the runtime-supplied JAXB message body reader should be used.
Same for producing.


> Bill Burke schrieb:
>> I know this is probably too late but...
>> A RESTEasy user brought up an interesting problem:
>> They have JAXB annotated classes, but their incoming mime type is
>> "application/". They want to use the
>> provided JAXB Provider, but have to extend the vendor-specific
>> class and register it themselves.
>> I guess it would be cool to allow:
>> @Produces("application/{regex}+xml")
>> or maybe regex's are overkill and something simple like:
>> @Produces("application/+xml") will match everything *+xml. I don't
>> know :)
>> Again, probably too late to get this in, but I'll log an issue
>> anyways.
>> Bill
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Marc Hadley <marc.hadley at>
CTO Office, Sun Microsystems.