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: John Pollard <email@hidden>
- Date: Wed, 21 May 2014 17:56:52 +0100
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