<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%@ page import="com.bean.*,com.dao.*,com.dao.impl.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'delStu.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<%
//处理删除操作
request.setCharacterEncoding("gb2312");
String id=null;
int stu_id=0;
id=request.getParameter("stu_id").trim();
if(id==null||id.equals(""))
{
out.println("<script> alert('删除失败,没有学生ID!');location='student.jsp'</script>");
return;
}
else
{
// 删除
stu_id= Integer.parseInt(id);
if(new StudentDaoImpl().delStu(stu_id))
{
out.println("<script> alert('删除成功!');location='student.jsp'</script>");
return;
}
else
{
out.println("<script> alert('删除失败!');location='student.jsp'</script>");
}
out.println("<script> alert('删除失败!');location='student.jsp'</script>");
}
%>
</body>
</html>