wood burning stoves 2.0*
The moose likes Servlets and the fly likes Doubt in using getParameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Doubt in using getParameter" Watch "Doubt in using getParameter" New topic
Author

Doubt in using getParameter

Karthik Vaidiswaran
Greenhorn

Joined: Jan 11, 2005
Posts: 16
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

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Karthik Vaidiswaran
Greenhorn

Joined: Jan 11, 2005
Posts: 16
Hello Ben,

Thanks a lot for the reply.

Regards
Karthik
 
GeeCON Prague 2014
 
subject: Doubt in using getParameter