1
I have a college exercise where I have to create a page. jsp that takes as parameter an "id" and runs a query to delete the record within the class products with this id and in case of any exception I send the user to page error.html passing as parameter the error text. The code I’ve made so far is this:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="web.acesso.bd.*,web.acesso.bd.dao.*"%>
<html>
<head><title>Insert title here</title></head>
<body>
<%
int myId=request.getParameter("id")
try{
bd.execComando ("DELETE FROM Filme id="+myId+");
}
catch(Exception e)
{
response.sendRedirect("erro.html");
}%>
</body>
</html>
So far I think it’s right, but I don’t know how to pass as parameter the exception message that is in the variable "and". Could someone help?
Well, I didn’t know about this Urlencoder,?
– Rodolfo Oliveira
I had a couple of syntax problems, I guess so solved.
– Bacco