When you are displaying the row, you might keep a hidden field that stores the value of id based on which the record is to be edited. Now make edit as hyper link or a button, and when it is clicked, pass the value of hidden field as query string to the corresponding servlet.