Olá
Foram ocorrer a problemas, veja em baixo.
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.NullPointerException
sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
java.lang.Double.parseDouble(Unknown Source)
ProdutosServelts.doGet(ProdutosServelts.java:19)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.26 logs.
CadastroProdutos.htm
<body>
<%
ProdutosDAO dao = new ProdutosDAO();
ArrayList<Categoria> todos = dao.listaCategoria();
%>
<center>
<h1>Cadastro do Produtos</h1>
<form action="ProdutosServelts" method="get">
<table>
<tr><td colspan="1">Nome do Produtos:</td><td colspan="3"><input type="text" name="nomeProd" size="50"></td></tr>
<tr>
<td align="left">Preço unitário:</td><td align="left"><input type="text" name="PrecoUnitario" size="15"></td>
<td>Categoria:</td>
<td>
<select name="categoria" size="1">
<option value="">---Selecionar---</option>
<%for(int i=0; i < todos.size();i++){ %>
<option value="<%=todos.get(i).getId() %>"><%=todos.get(i).getDescricao() %></option>
<%} %>
</select>
</td>
</tr>
<tr><td colspan="4">Descrição</td></tr>
<tr><td colspan="4"><textarea name="descricao" rows="5" cols="40"></textarea></td></tr>
<tr><td colspan="2"><input type="submit" value="Cadastro"></td><td colspan="2"><input type="reset" value="Limpar"></td></tr>
</table>
</form>
</center>
</body>
ProdutosServelts
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String nomeProd = request.getParameter("nomeProd");
int Categoria = Integer.parseInt(request.getParameter("categoria"));
String descricao = request.getParameter("descricao");
double preco = Double.parseDouble(request.getParameter("preco"));
ControleProdutos prod = new ControleProdutos();
prod.setNome(nomeProd);
prod.setCat(Categoria);
prod.setDescricao(descricao);
prod.setPreco(preco);
ProdutosDAO dao = new ProdutosDAO();
dao.incluirProdutos(prod);
}
Espero que vc me ajudem… obrigado!