Does Play provide any guarantees for queryString values order?

mavarazy

I'm adding generic extension to my Scala 2.11.6, Play 2.3.8 based project, based on Request.queryString

/**
 * The parsed query string.
 */
def queryString: Map[String, Seq[String]]

Lets say I have ?param=A&param=B. The order in which query returns A & B affects the result, of calculations.

Does play guarantee order of A & B?

In other words do I need to handle order of query parameters explicitly, or it's part of the system contract.

Salem

Does play guarantee order of A & B?

I don't think there is an explicit guarantee regarding the order of the params in Play (in general).

In the version I'm using now (Play 2.3.8), Play seems to use Netty's QueryStringDecoder and it indeed keeps the order of the values.

So with something like /some/path?param=1&param=7&param=4, queryString() will return

"param" -> ["1", "7", "4"]

but no one can assure you this will not change in the future (either in Netty or if Play decides to use something else).

If you are really just targeting 2.3.8, then I think you can safely assume the order is kept. If you want to use other Play versions, then you may want to use explicitly the version of Netty QueryStringDecoder used by 2.3.8:

QueryStringDecoder qs = new QueryStringDecoder("/a?param=1&param=7&param=4");
Map<String, List<String>> queryString = qs.getParameters(); 

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Does Debezium provide delivery and ordering guarantees?

분류에서Dev

Why does this SQL order null values last?

분류에서Dev

Kafka streams suppress does not return any values

분류에서Dev

Does making all fields final of an object guarantees safe publication?

분류에서Dev

How to play sound order by order?

분류에서Dev

Filter out value in foreach loop if it does not match any values in enum

분류에서Dev

ConcatRelated() Function to provide Unique Values on a Form

분류에서Dev

Why does this provide me with a stack overflow error?

분류에서Dev

Does bash provide support for using pointers?

분류에서Dev

Play는 queryString 값 순서에 대한 보증을 제공합니까?

분류에서Dev

Querystring for Paypal

분류에서Dev

Converting values within ORDER BY clause

분류에서Dev

Querystring 내부의 Querystring

분류에서Dev

grep words with all vowels in any order

분류에서Dev

mongoDB : find list in list with any order

분류에서Dev

how does ORDER BY take precedence?

분류에서Dev

Does GCP provide multi-regional VM instance?

분류에서Dev

Does Scala provide an easy way to convert Infix expressions to postfix ones?

분류에서Dev

How does VLC play youtube videos?

분류에서Dev

Remember my outlining or provide me any type of auto collapsing regions in ASPX files?

분류에서Dev

Clojure change values of a map without changing the order

분류에서Dev

Trying to get the max values in decending order mySQL

분류에서Dev

Using any or anyNamed matchers for nested values with Mockito

분류에서Dev

Any possibility to change BIOS default values?

분류에서Dev

What does this "Canonical does not provide updates..." mean in my package manager?

분류에서Dev

Is there any order exists in unordered_set in c++?

분류에서Dev

grep. Find multiple AND patterns in any order using single condition

분류에서Dev

Does the order of var in the javascript context matter?

분류에서Dev

Does the order of entries in the routing table matter?

Related 관련 기사

  1. 1

    Does Debezium provide delivery and ordering guarantees?

  2. 2

    Why does this SQL order null values last?

  3. 3

    Kafka streams suppress does not return any values

  4. 4

    Does making all fields final of an object guarantees safe publication?

  5. 5

    How to play sound order by order?

  6. 6

    Filter out value in foreach loop if it does not match any values in enum

  7. 7

    ConcatRelated() Function to provide Unique Values on a Form

  8. 8

    Why does this provide me with a stack overflow error?

  9. 9

    Does bash provide support for using pointers?

  10. 10

    Play는 queryString 값 순서에 대한 보증을 제공합니까?

  11. 11

    Querystring for Paypal

  12. 12

    Converting values within ORDER BY clause

  13. 13

    Querystring 내부의 Querystring

  14. 14

    grep words with all vowels in any order

  15. 15

    mongoDB : find list in list with any order

  16. 16

    how does ORDER BY take precedence?

  17. 17

    Does GCP provide multi-regional VM instance?

  18. 18

    Does Scala provide an easy way to convert Infix expressions to postfix ones?

  19. 19

    How does VLC play youtube videos?

  20. 20

    Remember my outlining or provide me any type of auto collapsing regions in ASPX files?

  21. 21

    Clojure change values of a map without changing the order

  22. 22

    Trying to get the max values in decending order mySQL

  23. 23

    Using any or anyNamed matchers for nested values with Mockito

  24. 24

    Any possibility to change BIOS default values?

  25. 25

    What does this "Canonical does not provide updates..." mean in my package manager?

  26. 26

    Is there any order exists in unordered_set in c++?

  27. 27

    grep. Find multiple AND patterns in any order using single condition

  28. 28

    Does the order of var in the javascript context matter?

  29. 29

    Does the order of entries in the routing table matter?

뜨겁다태그

보관