• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Retaining order of values in a url
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Retaining order of values in a url
      • From: Ramsey Gurley <email@hidden>
References: 
 >Retaining order of values in a url (From: John Pollard <email@hidden>)

  • Prev by Date: Retaining order of values in a url
  • Next by Date: Re: Retaining order of values in a url
  • Previous by thread: Retaining order of values in a url
  • Next by thread: Re: Retaining order of values in a url
  • Index(es):
    • Date
    • Thread