You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Ari King <ar...@gmail.com> on 2012/03/07 04:07:47 UTC
Re: Deserializing Encoded Query String
>> I've configured a method to receive query string parameters (see
>> below), but it does NOT receive all sent parameters.
>>
>> public Response lookup (@QueryParam("") CriteriaDto criteria) { ... }
>>
>> Seemingly encoded parameters are NOT populated in the DTO. For example,
>> given --
>>
>> Raw query string: ?locations[]=10001&name=ari
>>
>> Encoded query string: ?locations%5B%5D=10001&name=ari
>>
>> The "locations[]" parameter is ignored, whereas "name" is populated
>> in the CriteriaDto.
>>
> ? locations=10001
>
> should do, even if it's an array property on CriteriaDto
>
> Cheers, Sergey
Changing from locations[]=10001 to locations=10001 worked.
But is there a way to make locations[]=10001 work? Thanks.
Best,
Ari
Re: Deserializing Encoded Query String
Posted by Sergey Beryozkin <sb...@gmail.com>.
On 07/03/12 03:07, Ari King wrote:
>>> I've configured a method to receive query string parameters (see
>>> below), but it does NOT receive all sent parameters.
>>>
>>> public Response lookup (@QueryParam("") CriteriaDto criteria) { ... }
>>>
>>> Seemingly encoded parameters are NOT populated in the DTO. For example,
>>> given --
>>>
>>> Raw query string: ?locations[]=10001&name=ari
>>>
>>> Encoded query string: ?locations%5B%5D=10001&name=ari
>>>
>>> The "locations[]" parameter is ignored, whereas "name" is populated
>>> in the CriteriaDto.
>>>
>> ? locations=10001
>>
>> should do, even if it's an array property on CriteriaDto
>>
>> Cheers, Sergey
>
> Changing from locations[]=10001 to locations=10001 worked.
>
> But is there a way to make locations[]=10001 work? Thanks.
>
Is having 'locations[]' important for the consumers of the application ?
if yes - then you can use 'locations[]' but it won't work in conjunction
with the CXF parameter beans support, you'd need to handle the query
parameters manually...
Cheers, Sergey
> Best,
> Ari
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com