Re: Retaining order of values in a url
Re: Retaining order of values in a url
- Subject: Re: Retaining order of values in a url
- From: Ramsey Gurley <email@hidden>
- Date: Wed, 21 May 2014 10:13:06 -0700
?key2=val2&array=1&key=val&array=2&array=3
On May 21, 2014, at 9:56 AM, John Pollard <email@hidden> wrote:
> My workaround to put them back in order, using a TreeMap to sort on the index position within the URI.
>
> NSArray<String> formKeys = request().formValueKeys();
> String uriStr = request().uri();
> TreeMap<Integer, String> orderedKeysMap = new TreeMap<Integer, String>();
> for(String nextKey : formKeys)
> {
> orderedKeysMap.put(uriStr.indexOf(nextKey), nextKey);
> }
>
> On 21 May 2014, at 17:26, John Pollard <email@hidden> wrote:
>
>> Hi List,
>>
>> I note that WORequest.formValues() jumbles up the order of the values from a url. Is there a simple way to get them in order, or do I need to parse them out myself? I understand that normally the order shouldn't be important, but I have what I feel is a reasonable purpose for needing to know the order.
>>
>> Thanks
>> John
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden