Bug 55686 - make request.getParameterNames() and request.getParameterMap ordered
Summary: make request.getParameterNames() and request.getParameterMap ordered
Status: RESOLVED DUPLICATE of bug 55576
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.0.x-trunk
Hardware: PC All
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-22 03:25 UTC by quaff
Modified: 2013-10-22 23:58 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description quaff 2013-10-22 03:25:30 UTC
it should ordered by query string then post form data.
for example 
POST http://localhost:8080/test?a=a&b=b with form data "c=c&d=d&e=e"
request.getParameterNames() should return ["a","b","c","d","e"]
Comment 1 Violeta Georgieva 2013-10-22 06:28:46 UTC
Hi,

There was already a report for a similar issue - Bug 55576. The fix is available in 8.0.0-RC4 and yesterday it was announced the availability of 8.0.0-RC6.

I tried your scenario with the current trunk and the parameters are ordered.
Please provide a reproducible scenario against trunk.

Regards
Violeta
Comment 2 quaff 2013-10-22 07:51:28 UTC
wonderful,thanks very much,I have tested with 8.0.0-RC5,can you fix this in 7.0.x?
Comment 3 Violeta Georgieva 2013-10-22 08:02:13 UTC
It is fixed in 7.0.x also.

Currently we are voting 7.0.47 [1]. The fix is available in that version.

Regards
Violeta 

[1] http://markmail.org/message/yus4osg2bgaoekp6?q=7%2E0%2E47+list:org%2Eapache%2Etomcat%2Edev/

*** This bug has been marked as a duplicate of bug 55576 ***
Comment 4 Christopher Schultz 2013-10-22 12:48:33 UTC
The fix for bug #55576 might not entirely "fix" this enhancement as written.

For example, in this case:

/path/to/servlet?a=1&b=2&c=3&a=4

One might expect the return value of getParameterNames to be:

[ a, b, c, a ]

...but it will instead be [ a, b, c ].

"Ordering" the parameter map has the same "problem", but there is absolutely nothing to be done about that AFAICT.

I'm not suggesting that either of the above problems can be fixed... I just wanted to point-out the possible expectations users might have and how those expectations can't necessarily be met.
Comment 5 quaff 2013-10-22 23:58:51 UTC
@Christopher Schultz, it should be [a, b, c],and request.getParameterValues("a") will be [1,4]