Я использую JSP в качестве представления и сервлет в качестве контроллера.Это может быть из-за того, что сервлет не получает значения, idk.Я начинающий, поэтому, пожалуйста, помогите мне.
Кодовое представление Editar.jsp
<form action="/WebApp05/Controlador" >
<table class="table table-striped" style="width:autox; text-align:center; margin:50px auto;">
<thead>
<tr>
<th scope="col">Código</th>
<th scope="col">Nombre</th>
<th scope="col">Clave</th>
<th scope="col">Estado</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="value" value="${datos[0]}" name="codig">
<input type="hidden" value="${codig}" name="cod"></td>
<td><input type="value" value="${datos[1]}" name="nombre">
<input type="hidden" value="${nombre}" name="nom"></td>
<td><input type="value" value="${datos[2]}" name="clave">
<input type="hidden" value="${clave}" name="cla"></td>
<td><input type="value" value="${datos[3]}" name="estado">
<input type="hidden" value="${estado}" name="est"></td>
</tr>
</tbody>
</table>
<div class="botones">
<input type="hidden" name="accion" value="editar">
<button type="submit" class="btn">Guardar</button>
<a class="btn" href="/WebApp05/jstl_sql_a.jsp">Cancelar</a>
<p></p>
</div>
</form>
Servlet Controlador
if(accion.equals("editar")){
String cod = request.getParameter("cod");
String nom = request.getParameter("nom");
String cla = request.getParameter("cla");
String est = request.getParameter("est");
Connection xcon = this.Conectar();
sql = "update t_usuarios set cod='"+cod+"', nom='"+nom+"',clave='"+cla+"',est='"+est+"' where cod="+codigo+"";
PreparedStatement ps = xcon.prepareStatement(sql);
ps.executeUpdate();
request.getRequestDispatcher("jstl_sql_a.jsp");
}