基于b/s模式的jsp在线考试系统
源代码在线查看: delete.jsp~27~
delete
String name = request.getSession().getAttribute("name").toString().trim();
if(name==null)
out.print("alert('没有权限');history.back();");
String Ly_author = request.getParameter("Ly_Author").toString().trim();
if (name.equals(Ly_author)) {
String id = request.getParameter("ly_id");
int ly_id = Integer.parseInt(id);
boolean flag = LyBean.delete(ly_id);
if (flag) {
request.getRequestDispatcher("detail.jsp").forward(request, response);
}
else {
request.getRequestDispatcher("").forward(request, response);
}
}
else {
out.print("alert('没有权限');history.back();");
}
%>