Hi all,
I'm trying to create an edit form that retrieves data from a database using a result set and displays it on a table on a
JSP page. The retrieving part isn't the problem, because the data is being displayed on the table in the input text boxes like I wanted them to. The rows are also being created dynamically, so if, in the database there are 2 rows, then 2 rows will be displayed on the table.
The problem I am getting is as follows:
I want to be able to edit the data in the table, but only *one* row at a time. I.e., I have an update button at the end of each row of the table so that the user can update that row only. However,if there's more than one row in the table, and I attempt to update the 2nd, 3rd, 4th, etc row on the table by click the update button at the end of that row, the *first* row is being updated instead.
I think my problem is that even though the data on the table is being displayed as a loop, the data being sent back the update
servlet is not in a loop, so the servlet is only pulling the first row. What do I need to do to loop the data that the user has entered?
This is how the JSP looks:
And on the servlet, this is how the data is being retrieved: