modifyaction.jsp~17~

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

JSP~17~
40
字号
<%@page contentType="text/html; charset=GBK"%>
<%request.setCharacterEncoding("GB2312");%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>stu_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 rpassword = request.getParameter("rpassword");


    if (rpassword.equals(strpassword)) {
      if(strpassword.equals("")){
        out.print(show.errorBox("请填写密码!","错误信息"));
        return;
      }else{
        stu.setName(request.getParameter("name"));
        stu.setId((String)session.getAttribute("name"));
        stu.setDepartment(request.getParameter("department"));
        stu.setTeacher(request.getParameter("teacher"));
        stu.setPassword(request.getParameter("password"));
        stu.updateStu();
        out.print("<script>alert('修改成功!');document.location='index.jsp';</script>");

      }
    }
    else{
      out.print(show.errorBox("两次输入的密码不相同", "修改错误"));
    }
  %>
  </body>

</html>

⌨️ 快捷键说明

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