A tabela de cadastro tem (id, codigo, cliente, data, descricao, status, observacao) - id é int auto-increment e data é do tipo date
rof20004, valeu por completar o if
A classe de cadastro é primeira que postei no tópico, as outras estão abaixo.
pagina jsp de cadastro
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Cadastro de Changes</title>
</head>
<body>
<jsp:include page="cabecalho.jsp"></jsp:include>
<div align="center">
<form action="ChangesController" style="border:dashed; border:thin; border-color:#3580AC color: #0080FF; font-size: 10px; font-family: Tahoma, Verdana, Arial, Sans-Serif">
<h3>${mensagem}</h3>
<input type="hidden" name="cmd" value="cadastrarChanges"></input>
<table
style="color: #004080; font-size: 10px; font-family: Tahoma, Verdana, Arial, Sans-Serif; border-left-color: #3580AC; border-top-color: #3580AC; border-right-color: #3580AC; border-bottom-color: #3580AC"
border="1" bordercolor="#3580AC" cellpadding="5">
<thead>
<tr
style="color: #004080; font-size: 12px; font-family: Tahoma, Verdana, Arial, Sans-Serif; font-weight: bold">
<th>Atributo</th>
<th>Valor</th>
</tr>
</thead>
<tr>
<td>Código:</td>
<td><input id="codigo" name="codigo" style="height: 20px" value="${changes.codigo}"></input></td>
</tr>
<tr>
<td>Cliente:</td>
<td><input id="cliente" name="cliente" style="height: 20px" value="${changes.cliente}"></input></td>
</tr>
<tr>
<td>Data:</td>
<td><input id="data" name="data" style="height: 20px" maxlength="10" value="${changes.data}"></input></td>
</tr>
<tr>
<td>Descrição:</td>
<td><input id="descricao" name="descricao" style="height: 20px" value="${changes.descricao}"></input></td>
</tr>
<tr>
<td>Status:</td>
<td><input id="status" name="status" style="height: 20px" value="${changes.status}"></input></td>
</tr>
<tr>
<td>Observação:</td>
<td><input id="observacao" name="observacao" style="height: 20px" value="${changes.observacao}"></input></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Cadastrar" style="height: 25px; "></input></td>
</tr>
</table>
</form>
</div>
<jsp:include page="rodape.jsp"></jsp:include>
</body>
</html>
este input da jsp (value=“cadastrarChanges”), leva para:
public class ChangesHelper {
private HashMap<String, InterfaceCommand> mapaComandos;
private HttpServletRequest request;
private InterfacePool pool;
public ChangesHelper(){
try {
this.pool = new Pool();
} catch (SQLException e) {
e.printStackTrace();
}
mapaComandos = new HashMap<String, InterfaceCommand>();
mapaComandos.put("cadastrarChanges", new CadastrarChanges(new ChangesDAO(pool)));
mapaComandos.put("consultarChanges", new ConsultarChanges(new ChangesDAO(pool)));
mapaComandos.put("iniciarChanges", new IniciarChanges());
}
public void setRequest(HttpServletRequest request) {
this.request = request;
}
}
e acho que por fim, o IniciarChanges
public class IniciarChanges implements InterfaceCommand {
@Override
public String execute(HttpServletRequest request,
HttpServletResponse response) {
return "cadastro_principal.jsp";
}
}
e tem a classe DAO também, mas acho que ela não está implicando neste problema. Mas se precisar eu posto.