This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in using getParameter

 
Karthik Vaidiswaran
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My doubt is about getParameter method of the HttpServletRequest object. I have a form that submits 3 values(HPUnix, Solaris, Linux). When I retrieve these values and display them I get the values in reverse-alphabetical order , i.e (Solaris, Linux, HPUnix). I think that parameter values from a form are submitted in the order in the which the corresponding elements appear in the form. I assume that the reverse alhabetical order is because of getParameter method. Please let me know whether I am correct.

Thanks
Karthik.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They're being stored in a map, which means that you should not count on them coming out in any particular order. If you need them sorted, use getParameterNames, sort that and use the sorted list to retrieve them.
 
Karthik Vaidiswaran
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ben,

Thanks a lot for the reply.

Regards
Karthik
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic