First of all, you should learn about JSPs and generate your HTML markup from a JSP rather than from the servlet.
Now for your problem. Each of these rows comes from a database table. So each of these rows should have an ID (primary key). Assign the ID of the row to the value of the checkbox. When you submit your form, the servlet will receive all the IDs of the checked checkboxes. Get the values corresponding from these IDs from the database, and sum them (or execute a query that computes the sum directly):
<input type="checkbox" name="checkedRows" value="${idOfCurrentRow}">
In the servlet handling the form submission:
String[] checkedIds = request.getParameterValues("checkedRows");
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…