📄 addteacher_confirm.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="errorpage.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<jsp:useBean id="teacher" scope="request" class="stu.teacher">
<jsp:setProperty name="teacher" property="*"/>
</jsp:useBean>
<body bgcolor="#0099FF" text="#FFFFFF" link="#00FF00">
<div align="center">
<%
String admin_id = (String)session.getAttribute("id");
if(admin_id==null){response.sendRedirect("login.jsp");}
try{
String name=teacher.getName();
String id=teacher.getId();
String password=teacher.getPassword();
if(name==null || name.equals("")) throw new Exception ("错误,教师姓名不可为空!!");
if(id==null || id.equals("")) throw new Exception ("错误,教师号不可为空!!");
if(password==null || password.equals("")) throw new Exception ("错误,密码不可为空!!");
boolean f=true;
f=teacher.hasLogin();
if(f==false)
throw new Exception("教师号有重复,更新失败!!!");
else out.print("更新成功!"+"<br>");
out.print("教师姓名: "+name+"<br>");
out.print("教师ID: "+id+"<br>");
String title = teacher.getTitle();
out.print("职称 :"+title+"<br>");
teacher.addTeacher();
}catch(Exception e){
out.print(e.toString());
}
%>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -