users@jersey.java.net

[Jersey] Re: UriInfo getQueryParameters removing some characters

From: Jakub Podlesak <jakub.podlesak_at_oracle.com>
Date: Tue, 11 Oct 2011 12:37:09 +0200

Hi Leonardo,

'+' in URIs is used to encode space character.
You need to encode the plus character with %2B:

URI/?sort(%2Bfield1,-field2)

~Jakub


On 23.9.2011 21:09, Leonardo Helman wrote:
> Hi people, I'm trying to use a Jersey backend with a dojo frontend.
>
> dojo, dojox.data.JsonRestStore/dojox.grid.EnhancedGrid, when you click
> on a column to order the table, gives you something like:
>
> URI/?sort(+field1,-field2)
>
> I'm trying to use getQueryParameters (true/false, it does not change
> the behaviour) to access the fields (and the ascending/descending
> char, plus or minus).
>
> The getQueryParameters changes the "+" by a space.
>
> For example on this case:
>
> http://xxxxx/yyyy/?sort(+amounterrors,-step)
>
> getQueryParameters, returns:
> sort( amounterrors,-step) => ""
>
> Why the first "+" is removed?
>
> Am I doing something wrong?
> Is there any other way to retrieve this?
>
> Thanks in advance
> Saludos
> LeoH
>