To retrieve the Names of the form-element as the order !
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   arunachalam_p
Posted On:   Wednesday, April 18, 2001 12:53 AM

I am using request.getParameterNames() in my servlet, it returns the Enumeration type data. But the order is not a correct one..

I need the names must be sent in the same manner as in the HTML form..

Can anybody suggest me please! I need it very urgently.. I will be thankful to the responder very much.

Thanx in Advance,

Re: To retrieve the Names of the form-element as the order !

Posted By:   stef_mik  
Posted On:   Wednesday, April 18, 2001 01:07 AM

No other choice but to precede the names
with a digit like 0.first_name, 1.last_name, etc...

if you have more than 10 parameters,
make it a double digit like 00.first_name, 01.last_name

When you have done this, load the
enumeration inside a Collection implementation, and do Collections.sort().

You will then have them in the right order.

NOTE: the Servlet 2.3 specs can provide
you with a request parameter Map which
allows you to skip the extraction of the Enumeration.
About | Sitemap | Contact