- A jsp page with a like of Item Details populated in a table.
- User will modify any of the data in any of the column.
- After submitting the jsp the updated details needs to be saved in database
we are able to display in screen. But the List is set to null if we submit the same form again.
The list iteration is like below:
I have searched in net for the solutions. But I couldn't find any thing. Hence I have to go for a hard solution as below:
- Once after the list is displayed in Jsp, in the Onclick of Submit button, I have called a javascript:function.
- The list of data displayed is retrieved using the javascript by browsing through the tags inside the jsp.
- The retrieved data is converted into a string buffer with "," appended for each column values and ";" appended for each rows.
- After creating the string buffer, It is set to a variable in a form( say hiddedDataList).
- Finally, the variable with the string is set as hidden variable using html:hidden.
- We can again tokenize the string from the variable and create a list and save in the same list variable of form.