users@jersey.java.net

[Jersey] Re: Getting FormsParams in MultivaluedMap

From: Martin Matula <martin.matula_at_oracle.com>
Date: Wed, 19 Oct 2011 16:57:29 +0200

Yes, this should work. You can also try using "Form" class instead of
MultivaluedMap<String, String>. See if that helps.
Also check how the request you are getting looks like (add LoggingFilter
on the server side to spit out the request body).
Martin

On 19.10.2011 8:35, gregor.karl.frey_at_t-online.de wrote:
> Hi,
> I'm struggling to get somehow the forms parameter as a multivalued map
> in a post request. The procedure described in the users guide doesn't
> work, at least not for me:
>
> "For form parameters it is possible to do the following:
>
> Example 2.19. Obtaining general map of form parameters
>
> 1 @POST
> 2 @Consumes("application/x-www-form-urlencoded")
> 3 public void post(MultivaluedMap<String, String> formParams) {
> 4 // Store the message
> 5 }
> "
>
> Is this description correct? No annotation for the formParams?
> When I try this the map is always empty ;-)
> Thanks for any suggestions!
> Gregor