POSTed form data

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Thu, 14 Feb 2008 16:26:48 -0500

Issue 30[1] requests that we improve support for POSTed form data,
either by supporting it with the existing @QueryParam annotation or by
adding a new annotation, e.g. @PostParam or @FormParam.

Note that we already require support for

@POST @ConsumeMime("application/x-www-form-urlencoded")
public Foo update(MultivaluedMap<String,String> formData) {
   String name = formData.get("name");

where formData can be used to get at the individial form fields.

The suggested addition would add support for doing something like:

@POST @ConsumeMime("application/x-www-form-urlencoded")
public Foo update(@QueryParam("name") String name) {...}

Opinions ?

If you are in favor, do you think this warrants a new annotations or a
change to the existing @QueryParam.

If you favor a change to @QueryParam then which should take precedence
if the same name is used for a field in the request entity and a URI
query param ?



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