lundi 30 mars 2015

checkbox index value in java

I am working in spring mvc, I used the following line to generate the checkboxes from DB table.



<td><input type="checkbox" name="loanId" value="${loan.id}" class="it"></td>


I need to get the index of this selected values in my java controller. I am able to get the values which are selected, but how to get the index values? enter image description here following code is I am using



String[] loanIds = request.getParameterValues("loanId");

for (String string : loanIds) {
System.out.println("loanIds****"+string);
}

Aucun commentaire:

Enregistrer un commentaire