Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

request.getParameterValues()  RSS feed

 
Zkr Ryz
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ranchers.
I have a doubt.
When submiting values of a form , the order in which they are "written" to the query string is the same as the order you
put it on the html??
If so, is the request.getParameterValues() string array
in that same order ???
example.
If put three checkboxes whose names are the same "cb" and the values are 1, 2 and 3,
input type="checkboxc" b name="cb" value="1"
input type="checkboxc" b name="cb" value="2"
input type="checkboxc" b name="cb" value="2"
when the form is submitted the query string would always be
cb=1&cb=2&cb=3 ??
or could be any combination like
cb=3&cb=2&cb=1 ,
cb=2&cb=1&cb=3 or
cb=3&cb=1&cb=2.
In the first case the array returned by request.getParameterValues("cb")
would have the strings in that same order ?
{"1","2","3"}
What happen when the form method property is "POST" ??
Thanks.

 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Personally, I will NOT depend on the
order in which the srtings are returned.
Currently, I can't find any doc. to support
my argument, but I remember this recommendation
from some literature I read a while back.
Hopefully someone (authors) could elaborate on
this...
regds.
- satya
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
GetParameterValues returns them in the order in which they appear. Since they all have the same name. getParamaterNames() is not guaranteed to return them in the order they appear.

Bosun
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!