zoukankan      html  css  js  c++  java
  • 第四个JSP作业-验证

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>登录页面</title>
    </head>
    <body>
    <form name="myform" method="post" action="B.jsp" >
    <table align="center">
    <tr>
    <td>
    <img src="image/Snap1.jpg"><div style="position:absolute; left: 490px; top: 220px;  400px;">
      <table width="100%" height="100%" border=0 cellPadding=0 cellSpacing=0>
            <tr vAlign=top> 
                <td width="23%" 
                    height="27" align=right class=bld>用户名: </td>
                <td height="27" align=left><input type="text" size="20" name="u_name"><br>用户名由字母和数字组成</td>
            </tr>
            <tr vAlign=top> 
                <td class=bld align=right height=27>密码: </td>
                <td height="27" align=left><INPUT TYPE="password" size="20" name="u_pswd"><br>密码由字母、数字和下划线组成,至少6位</td>
            </tr>
            <tr vAlign=top> 
                <td class=bld align=right height=40> </td>
                <td  align=left valign="middle"><a href="#"><input name="submit" type="image" src="image/login.gif" width="101" height="22" border="0" ></a> 
                </td>
            </tr>
       </table>
       </div>
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    

      

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>验证页面</title>
    </head>
    <body>
    <%
    	String name=request.getParameter("u_name");
    	String pswd=request.getParameter("u_pswd");
    	if(name.equals("lucky") && pswd.equals("123456")){
    		out.print("你好,"+name+"!");
    		request.getRequestDispatcher("C.jsp").forward(request, response);
    	}else{
    		request.getRequestDispatcher("D.jsp").forward(request, response);
    	}
    %>
    </body>
    </html>
    

      

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>验证成功</title>
    </head>
    <body>
    <h1>验证成功!</h1>
    <h2>你好: 
    <%
    	String name=request.getParameter("u_name");
    	out.print(name);
    %>
    </h2>
    </body>
    </html>
    

      

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>验证失败</title>
    </head>
    <body>
    <h1>验证失败!</h1>
    <input type="button" value="重新登录">
    </body>
    </html>
    

      

  • 相关阅读:
    Linux下命令行安装weblogic10.3.6
    11g新特性:Health Monitor Checks
    Oracle/PLSQL: ORA-06550
    DBMS_NETWORK_ACL_ADMIN
    【RDA】使用RDA(Remote Diagnostic Agent)工具对数据库进行健康检查
    ORA-39242 错误
    Yii2 中常用的增删改查操作总结
    PHP递归函数return返回null的问题
    PHP中生成随机字符串,数字+大小写字母随机组合
    使用layer.msg 时间设置不起作用
  • 原文地址:https://www.cnblogs.com/minmeishaonv/p/12607460.html
Copyright © 2011-2022 走看看