📄 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="sqlB" scope="request" class="stu.sqlBean"/>
<body bgcolor="#4692B3" text="#FFFFFF" link="#00FF00">
<div align="center">
<%
String admin_id = (String)session.getAttribute("id");
if(admin_id==null){response.sendRedirect("login.jsp");}
try{
String id=request.getParameter("id");
String name=new String (request.getParameter("name").getBytes("iso8859_1"),"gbk");
String password=request.getParameter("password");
String title=new String (request.getParameter("title").getBytes("iso8859_1"),"gbk");
if(name==null || name.equals("")) throw new Exception ("错误,教师姓名不可为空!!");
if(id==null || id.equals("")) throw new Exception ("错误,教师号不可为空!!");
if(password==null || password.equals("")) throw new Exception ("错误,密码不可为空!!");
out.print("新增成功!"+"<br>");
out.print("教师姓名: "+name+"<br>");
out.print("教师ID: "+id+"<br>");
out.print("职称 :"+title+"<br>");
String sql="insert into teacher(id,name,title,password) "+ "values('"+id+"','"+name+"','"+title+"','"+password+"') ";
sqlB.executeInsert(sql);
}catch(Exception e){
out.print(e.toString());
}
%>
</div>
<p> </p>
<p><a href="addteacher.jsp"><<Back</a></p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -