0
I have a table where there’s a column
ID - NAME - ACTION
1 -- USU1 -- VER
2 -- USU2 -- VER
3 -- USU3 -- VER
in JSP I am storing the id inside a Hidden input.
<input type="hidden" value="${operador.id }" name="idOperador"/>
In Java I call this value through
int id = Integer.parseInt(request.getParameter("idOperador"));
Only independent of the item I click on "VIEW", it is taking the value of the first row of the table. In this case the id "1" or the first of the next pages.
Some guidance ?
Part of the code: This is within a table, where one of the columns (actions) consists of the action buttons (view, change and delete). When selecting the change option, it is taking the id of the first row of the table.
Note: this inside a foreach (JSTL)
<td class="actions">
<input type="hidden" value="${operador.id }" name="idOperador"/>
<div align="center">
<div class="btn-group" role="group">
<button type="button" class="btn bg-cyan waves-
effect">Visualizar</button>
<button type="submit" name="command" value="DadosAlterarOperador"
class="btn bg-cyan waves-effect">Alterar</button>
<button type="button" class="btn btn-danger waves-
effect">Excluir</button>
</div>
</div>
</td>
Apparently you are only setting a single ID in the Hidden field. Post the entire code snippet so we can analyze it better.
– Marquezani
@Marquezani, I changed the question by adding a piece of code.
– Kennedy Anderson