第四次作业

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<style>
    body{
    600;
    height:500px;
    overflow: hidden;
    position: relative;
    background-repeat: no-repeat;
    background-image:url(chengshi_yejing-007.jpg);
    }
    div{
     400px;
    height: 150px;
    padding-top: 10px;
    margin: 50px auto; 
    background: #00000000; 
    position:relative;
    top:100px;
    }
    form{
     300px;
    height: 150px;
    padding-top: 10px;
    margin: 50px auto;                                          
    background: #00000000;                                     
    border-radius: 20px;                                        
    border: 3px solid #f8fcfc;
    opacity: 0.9;
}
    </style>
  <head>
    
  </head>
  <body>
  <div>
    <form action="login.jsp" method="post">
       账号:<input type="text" name="name"><br>
       密码:<input type="password" name="password" ><br>
       验证码:<input type="text" name="yanzheng" >
     <input type="text" name="ma" value="4500" readonly="readonly"><br>
    <input type="submit" value="登录">
    </form>
  </div>
   
  </body>
</html>
<%@ page  language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
    <%
        String Name = request.getParameter("name");
        String Password = request.getParameter("password");
        if(Name.equals("zs")&&Password.equals("123")){
          request.getRequestDispatcher("success.jsp").forward(request,response);
    }else{
        request.getRequestDispatcher("fail.jsp").forward(request,response);
    }
           %>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    

  </head>
  
  <body>
    <h2>您已成功登录</h2>
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>


  </head>
  
  <body>
    <h2>登录失败</h2>
  </body>
</html>
原文地址:https://www.cnblogs.com/nmzAmbition/p/14596379.html