zoukankan      html  css  js  c++  java
  • 编写一个jsp程序,实现用户登录,当用户输入的用户或密码错误时,将页面重定向到错误提示页,并在该页面显示30秒后 自动回到用户登录界面

    <%@ 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>Insert title here</title>
    </head>
    <body>
    <form action="panduan.jsp" method="post">
    名称:<input type="text"  name="name">
    <br>
    密码:<input  type="password"  name="password">
    <br>
    <input type="submit" value="提交"> 
    </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>Insert title here</title>
    </head>
    <body>
    <% String name=request.getParameter("name");
    String password=request.getParameter("password");
    %>
    <%if(name.equals("test1")&&password.equals("123456"))
        {
        out.print("密码正确");
        }
        else
        {
            response.sendRedirect("cuowu.jsp");
        }%>
    
    </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>Insert title here</title>
    </head>
    <body>
    账号密码输入错误
    </body>
    </html>

  • 相关阅读:
    Windows 10 开发日记(二)-- 手势顺序调研
    Windows 10 开发日记(一) -- 手势通览
    开篇说两句
    我从上海回苏州了,你懂的!
    数组名相关
    指针相关笔记
    static相关
    输入分式,输出化简式的C语言算法
    语句界定
    switch相关
  • 原文地址:https://www.cnblogs.com/jskbk/p/5615834.html
Copyright © 2011-2022 走看看