Hi I am using jsp tag libraries to fetch data(11 columns) from a table and display in editable format(50 records per page) to the user. I have completed till this. Now, the user can modify any of the contents displayed on the page. After modifying the contents, he can hit save button to insert all the data on the screen to a new table.
I am confused how to read this 50 records form data using servlets or jsp. Please help.
Hi Kalai, As you're using a loop in your jsp page to create each record, and you're creating 50 records, so you have in your generated html page for example (50 field with the name "employeeName", 50 field with the name "ID", ....), right? so when you want to retrieve the values of those fields all you'll get is the last value set only.. so in order to trick this do this: 1- In your jsp page and while naming your fields write it like that:
now you have numbered fields in your generated html page: -For record 1 --> employeeName1, ID1, .... -For record 2 --> employeeName2, ID2, .... ....
2- In your servlet that is supposed to save those records just let it do the next:
and that's it.. I've done it before and it worked for me, for more details just inform me please..
Always look on the bright side of life. At least this ad is really tiny: