I have a problem with struts form-submission.
I want to insert entries to a DB using a form. The form looks something like this.
1. Entry 1 [submit]
2. Entry 2 [submit]
The number of rows is dynamic.Every row has a "Submit" button. When the user hits the button, the DB is updated with the row's data. This is done via an ActionForm, which will pass the parameters to the db via a single SQL insert statement. All this works (for a single row "insert")
What I want to achieve is for the user to amend the entries, then hit a single submit button, to insert all the rows' data in one go, like so
1. Entry 1
2. Entry 2
[Submit All]
How can i achieve this? Is there a way to loop through the entries, doing the "insert" statement multiple times (depending on the number of rows on my table?). The "Insert" statement works for only one row. I do not wish to change the insert statement. The main problem is that the number of rows is not-fixed.
If anyone can point to me a similar solution online, it'll be mightly fine. Thanks!