• jsp第四次作业


    login.jsp

    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
          <style type="text/css">
          div{
              text-align: center;
              margin: 0 auto;
          }
          .password{
               200px;
               
          }
          body{
              background: white;
          }
          .sub{
              300px;
          }
          h1
          {
          color:orange;
          text-size:20px;
          }
          </style>
      </head>
      
      <body>
      <div>
          <h1>学生登陆</h1>
          <form action="dologin.jsp" method="post">
              学号:<input type="text" name="uname" class="name"><br>
              密码:<input type="password" name="upassword" class="password"><br>
              验证码:<input type="password" name="upassword" class="password"><br>
              <input type="submit" value="登录" class="sub">
          </form>
      </div>
          
      </body>
    </html>
    

      dologin.jsp

    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <%
        String name=request.getParameter("uname");
        String password=request.getParameter("upassword");
        if(name.equals("zs")&&password.equals("123")){
            request.getRequestDispatcher("ok.jsp").forward(request,response);
        }else{
            request.getRequestDispatcher("no.jsp").forward(request,response);
        }
     %>
    

      loginOK.jsp

    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
      </head>
      
      <body>
          <h1>登陆成功</h1>
      </body>
    </html>
    

      loginFail.jsp

    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
      </head>
      
      <body>
          <h1>登陆失败</h1>
      </body>
    </html>
    

      

  • 相关阅读:
    Linux学习(三十一)系统日志
    Linux学习(三十)rsync的使用
    php检测文字编码的方法
    Phpexcel使用
    高并发秒杀解决方案(转载)
    通过CSS选择器查找元素
    通过PartiaLinkText查找元素
    通过LinkText查找元素
    通过TagName查找元素
    通过ClassNmae查找元素
  • 原文地址:https://www.cnblogs.com/s2me/p/14590588.html
Copyright © 2020-2023  润新知