wink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gulack <gul...@gmail.com>
Subject Empty List/Array with @FornParam
Date Mon, 26 Mar 2012 10:15:07 GMT
Hi

I'm using Apache Wink for implementing REST Services and I can't seem to
receive parameters of type array or List. The call is being made from ajax
$.post:


$.post(url,
    { param: ['string1', 'param2', 'x', 'etc...etc....etc'],
        str2: "str2"},
});

    function(data) {// do something   });


On the server side, Strings and ints are correctly received, but the
'param' parameter is always received empty (not null, but with zero
elements), whether the variable is defined as String[], List, Set, ... .
The receiving function is defined as:


@POST @Produces("application/json") @Path("eee")
public Response eee(@FormParam("str1") String str1, @FormParam("param")
String[] param, @FormParam("str2") String str2)

While debugging, I can see a context variable with a table entry like:


wink.formParameters=[param%5B%5D=string1,param%5B%5D=param2,
param%5B%5D=x,param%5B%5D=etc...etc....etc,str2=str2]

That translates to 'param[]=string1, param[]=param2, ..', no indexation.
Don't know if that's correct.
Any ideas ?

Thanks

Mime
View raw message