• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to retrieve parameters in the exact order?

 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm using request.getParameterNames() to retrieve parameters but it does not preserve the order in which they appeared on the HTML form. My application does not depend on the order of parameters but I just want to know if It is possible to retrieve the parameters in the exact order?
thanks for any idea.
Thanks,
Mokrane
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can always get the query string from the string and parse it yourself. As far as I know, however, the parameters are allowed to be placed in an unordered hash. Do a "search" on the JavaRanch and you may find this topic discussed in detail about a month or so back.
Since that forum was just split into separate Servlet and JSP forums I have no idea what the best way to look would be, though...
 
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not very experienced in this area but easy way might be to name your fields on HTML in some kind of order by prefixing "a thru z" for example and then use Collection.sort(List list) on the servlet side after retrival Again I am not an expert and never needed to do this.
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
do
recSrNoMan=request.getParameterValues("recSrNoManHid");
recSrNoManHid --- html variable
nad
String[] recSrNoMan= {};
so as many values are there will fit in the array
 
Reda Mokrane
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for all your help.
Reda Mokrane
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic