reg.jsp~29~

来自「教学管理系统的JAVA实现代码」· JSP~29~ 代码 · 共 36 行

JSP~29~
36
字号
<%@page contentType="text/html; charset=GBK"%>
<%request.setCharacterEncoding("GB2312");%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>ste_reg</title>
</head>

<jsp:useBean id="show" class="base.page.Show" scope="page"/>
<jsp:useBean id="stu" scope="session" class="base.Student"/>

  <body bgcolor="#ffffff">
  <%

  String strpassword = request.getParameter("password");
  String strrpassword = request.getParameter("rpassword");


    if (strrpassword.equals(strpassword)) {
      stu.setName(request.getParameter("name"));
      stu.setId(request.getParameter("id"));
      stu.setDepartment(request.getParameter("department"));
      stu.setTeacher(request.getParameter("teacher"));
      stu.setPassword(request.getParameter("password"));
      stu.addStu();
      out.print(show.errorBox("欢迎注册本系统!", "欢迎"));
      out.print("<script>alert('注册成功!');document.location='login.jsp';</script>");

    }
    else
      out.print(show.errorBox("注册错误", "注册错误"));
  %>
  </body>

</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?