My controller returns me a list of objects, which i render on a jsp. Whats i want to do is select a single row and mark it to be deleted.
But im not sure how to go about this:
I started with this:
form
table
c:forEach var="book" items="${booklist}"
tr
td>{book.id}</td
td>{book.Number}</td
td>{book.Address}</td
td><input type="submit" name="delete" value="{book.id}" ..</td
tr
c:forEach>
table>
(…apologies for formatting…)
I have two problems with the above, firstly it displays the id on the button. and secondly i still would ideally like to bind the selected row to a form so i can do some validation
any ideas?
I would wrap each row in it’s own form, with a hidden input holding the id of the book to delete:
Don’t forget your $s.