這是deleteProduct.jsp頁面代碼。 問題是隻有轉發標記和DB操作很好。 我用轉發標記去adminProducts.jsp 但結果是不正確的。 它顯示adminProducts.jsp頁面內容,但地址欄顯示deleteProduct.jsp 最新問題和我該如何解決這個問題?jsp:轉發標記無法正常工作?
<%@ page contentType="text/html;charset=UTF-8"%>
<html>
<%@ page import="org.j2os.shine.jconnection.JDBC" %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>delete product</title>
</head>
<body>
<%
String id = request.getParameter("id");
out.print(id);
JDBC mydb = new JDBC();
mydb.login("com.mysql.jdbc.Driver","jdbc:mysql://localhost/rouyesh", "username", "password", true);
mydb.executeSQLQuery("delete from products where id=" + id);
mydb.commit();
%>
<jsp:forward page="adminProducts.jsp"></jsp:forward>
</body>
</html>
瞭解的servlet取代
。 – BalusC 2010-10-16 00:16:47