users@jsr311.java.net

Re: x-www-form-urlencoded Content Type and rest WS

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 19 Aug 2008 19:33:34 +0200

Hi Denis,

Did you try either of the following:

   @POST
   @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
   public void post(MultivaluedMap<String, String> form) {
      String a = form.getFirst("a");
   }

   @POST
   @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
   public void post(@FormParam("a") String a, @FormParam("b) int b) {
   }

This works with the RI (Jersey) version 0.8 and onwards, however the
@FormParam for Jersey 0.8 is a Jersey specific class.

The @FormParam was pulled into the JAX-RS API version 0.9 and is
implemented in Jersey 0.9-ea-SNAPSHOT which will be released this Friday.

Paul.

Denis wrote:
> Hi all,
>
> I need to set up a web service which consume a "x-www-form-urlencoded"
> content.
> I tried to use CXF and Jersey but without success. I do not know how to
> get my parameters
> after posting them through a form.
> Has anyone ever use one of this framework and this kind of Content Type??
>
> Thanks for your support.
>
> Denis

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109