Click to See Complete Forum and Search --> : ArrayList generation in JSP


thisisboni
November 29th, 2004, 08:58 AM
Hi,
I have a jsp page where I want to enter the grades of a student.

Now I am populating the student field from an arrayList retrieved from a servlet (this part is working fine !)

However, I am not sure how I collect all the graded (input from user) into an ArrayList and pass it to a servlet !

<input type="text" name="grade" size="10" maxlength="30">
doing this would return a 1 string I want to get the "grades" as an ArrayList

thanx,
Samik

quinman
November 30th, 2004, 11:12 AM
Hi Samik

I'm not a JSP man, more ASP but i would do it like this


If you want to enter all the grades at once you could enter a comma delimited string ie strGrades="A,B,C,D,E"

when you receive the string from your form post in ASP you can split the string into an array

arrGrades=split(strGrades, ",")

this would leave

arrGrades[0]="A"
arrGrades[1]="B"
arrGrades[2]="C"

etc

Any help?