users@jsr311.java.net

entity providers and multiple arguments of the same type

From: Bertold Kolics <Bertold.Kolics_at_Sun.COM>
Date: Tue, 03 Jun 2008 15:43:52 -0500

Is it possible to have a resource method with multiple arguments of the
the same type if none of these arguments are mapped to URI parameters?
For example:

@POST
@Path("service")
public Response resourceMethod(ServiceClass argument1, ServiceClass
argument2);

I don't see in the MessageBodyReader interface how an implementing class
could determine whether the argument1 or argument2 is to be mapped from
the entity body when the readFrom method is called. The implementation
in the Jersey project calls the message body reader twice in the above case.

Should the specification perhaps imply that each request should be
serviced by at most one message body reader?

It would be great if Providers were added to the terminology section
(1.5). I felt that the Constructors (4.2) section should be numbered
4.1.1. Otherwise, it looks like yet another type of provider.

Thanks for your help.

Bertold