This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Form Submission. Multiple "Insert" Statements.

 
Mervin Chan
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the Struts forum...
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
StrutsCatalogLazyList
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic