Re: JSR311: multipart

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 29 Feb 2008 09:43:20 -0500

On Feb 29, 2008, at 9:30 AM, Bill Burke wrote:

> I know we discussed this before, but, another thing MessageReader/
> Writer's need is access to the GenericType of the thing being
> (un)marshalled.
Its there in trunk but I haven't updated the online javadoc yet:


> Bill Burke wrote:
>> I don't know if jax-rs plans to add support for multipart (form-
>> data, mixed, etc...) (I wish we would figure out an abstraction),
>> but currently I don't see a way of supporting it portably in the
>> current model.
>> The main reason is that there is no way of looking up providers by
>> mediaType and class. There used to be a createMessageBodyReader/
>> Writer. I wish we could bring that back. That way, a mulitpart
>> @Provider could look up and call marshalling based on this. i.e.
>> public interface MultipartMixed {
>> public void writeObject(MediaType type, Object obj);
>> }
>> or
>> @ProduceMime("multipart/mixed")
>> List<String> get() { ... }
>> @Provider will have a match based on multipart, Collection as a
>> type. It iterates through the collection and finds a
>> MessageBodyReader or Writer. Creates its own header/outputstream
>> objects, calls the reader/writer, returns.
>> or
>> @ProduceMime("multipart/form-data")
>> MyForm
>> get()
> --
> Bill Burke
> JBoss, a division of Red Hat
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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