I have a table which one column is button, how can I send ${user.key} the to the servlet when I click over the button?
<form action="InstitutionManagementServlet" method="post" >
<c:forEach items="${requestScope.AllUsers}" var="user" varStatus="loop">
<tr>
<td class="numberWidth">${loop.index + 1}</td>
<td class="nameWidth" id="${user.key}">${user.value}</td>
<td><input type="submit" name="Deactivate" value="Deactivate"/></td>
</tr>
</c:forEach>
</form>
There are two approaches for this.
Pass it as button value (and use
<button>instead of<input>so that you can give it a label)with
Or, put each button in its own form with the key as a hidden field.
with