Problem with getParameterValues()

I have a number of data input sets which I need to get dynamicly. Sometimes there are amny, sometimes there are none. I thought getParameterValues() would return me an array of strings with my data.

For instance, I render this -

<INPUT type="text" name="fname" value="" SIZE = "25" maxlength="25">

On submit, I am trying to get the values for fname like this

fNames= req.getParameterValues("fname");

On the back end,

System.out.println("param "+fNames[j]);

renders "param fname"

Shouldn't fNames[j] have the user input for the given instance of the fname field?

[627 byte] By [psurossa] at [2007-10-3 0:36:54]
# 1

Enumeration formElements = request.getParameterNames();

while(formElements.hasMoreElements())

{

String formElementName = (String) formElements.nextElement();

String formElementValue = request.getParameter(formElementName);

out.println("<b>"+formElementName+" : </b>"+formElementValue);

}

HTH.

gfortya at 2007-7-14 17:30:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...