How do I get all the parameterNames in an HTML form in the same sequence as they are in the form.
i.e if the form contains .... FirstName, LastName, MiddleName and
request.getParameterNames ()
uses HashMap
internally to store the name value pairs of form fields. There is no order maintained in this. if you need this in order then , some sort of naming convention for form parameters to control the order of retrieval.
SortedSet temp = new SortedSet();
Enumeration enumeration = request.getParameterNames();
while (enumeration.hasMoreElements())
{
temp.add((String)enumeration.nextElement());
}