So, you have a list with data, and form fields above it. You want to select a line in the list, and on selection, you want the above form fields to be filled out with the data from the selected line in the list?
Yeah, thats pretty much what I want to do, except that, the items are in a table, with check boxes for every row. On select of a particular row, the servlet call should query for that row of info and display it in the form fields.
First of all, in my opinion, i don't think you need to query your DB again, because your LIST is allready there, with all the data needed! I see that the data in the list is as much as the data in the form. If the list is hold in the session, you can just use it again!
For selection of a row, there is no need for using form elements. You can just, use a html anchor element to create a link to you servlet. Just pass an ID to the servlet, that tells wich row you want to select.
Once the server (your servlet) knows wich row you want, you can get the "x"-row from your List, this will return your "details" instance.
You can choose how you put it back to your client (JSP). You can use Ajax with Json or something, to fill up the fields, or you can just redirect again to your page, using jstl to access the "detail" instance, and put it in your fields "value".