Olá pessoal,
estou tentando rodar o programa abaixo e me da um erro mas não estou conseguindo
visualizar onde está dando erro???
Se alguém puder me ajudar agradeceria…
abs
Paulo
<%@ 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">
<%@ page content Type ="text/html"%>
<%@ page pageEnconding ="UTF-8"%>
<%@ page import ="org.hibernate.*"%>
<%@ page import ="org.hibernate.cfg.*"%>
<%@ page import ="br.com.wincomp.loja.*"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<LINK href="estilo.css" type="text/css" rel="stylesheet">
<title>Primeiro exemplo do curso de J2EE</title>
</head>
<body>
<h2>Primeiro exemplo </h2>
<%
int idcategoria =0;
String categoria ="";
if ( (request.getParameter("idcategoria") != null) && (request.getParameter("categoria") != null )) {
try{
idcategoria =Integer.parseInt(request.getParameter("idcategoria"));
categoria = request.getParameter("categoria");
SessionFactory sf;
sf = new Configuration().configure("br/com/loja/hibernate.cfg.xml").buildSessionFactory();
Session s = sf.openSession(); // abre session
Transaction tx = s.beginTransaction(); //cria transação
Categorias c = new Categorias();
c.setIdcategoria(idcategoria);
c.setCategoria(categoria);
s.saveOrUpdate(c);
tx.commit();
s.close();
out.println("Gravou...");
}catch(Exception x){
out.println(x.getMessage());
}
}else{
out.println("Não gravou");
}
%>
</body>
</html>
erro :
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /salvarcategoria.jsp(5,17) equal symbol expected
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs