users@jersey.java.net

Re: [Jersey] Lists as QueryParams

From: Felipe Gaścho <fgaucho_at_gmail.com>
Date: Thu, 28 Jan 2010 09:06:34 +0100

> IIRC, the way you have it now matches what a HTML form would produce. One thing to

+1

Form is the way to go ...

an example:

@POST
@Produces( { MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public Response insert(@Context UriInfo info, @Context HttpHeaders headers,
                @FormParam("login") String login,
                @FormParam("password") String password,
                @FormParam("email") String email, @FormParam("name") String name,
                @FormParam("confirmationUrl") String url,
                @FormParam("key") String key, @FormParam("locale") String locale) { ... }

http://kenai.com/projects/puj/sources/arena/content/arena-http/src/main/java/com/kenai/puj/arena/http/PujUserResource.java