zoukankan      html  css  js  c++  java
  • 作业-1

    <%@ 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="NewFile1.jsp">        
    账户名称:
    <br>
    <input name="zhanghu" type="text" width="30" />
    <br>
    密码:
    <br>
    <input name="mima" type="text" width="30" />
    <br>
    <input type="submit" value="提交"/>
    </form>
    </body>
    </html>
    1
    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8" %>
        <%@ page errorPage="NewFile2.jsp"%>
    <!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 zh =new String( request.getParameter("zhanghu").getBytes("ISO-8859-1"),"UTF-8");
        String mm =new String( request.getParameter("mima").getBytes("ISO-8859-1"),"UTF-8");
    
    if ( zh.equals("zhanghu"))        
    {
        if(mm.equals("mima"))
        {
            response.sendRedirect("NewFile3.jsp");
        }
        else
        {
            response.sendRedirect("NewFile2.jsp");
        }
    }
    else
    {
        response.sendRedirect("NewFile2.jsp");
    }
    %>
    </body>
    </html>
    2
    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8" isErrorPage="true"%>
    <!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>
    输入有误!
    <% 
    response.setHeader("refresh","30;URL=NewFile.jsp");
    %>
    </body>
    </html
    3
    <%@ 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>
    4
  • 相关阅读:
    Java虚拟机基础
    排序系列之插入排序
    排序系列之冒泡排序
    成为优秀程序员的10个要点
    23个适合Java开发者的大数据工具和框架
    成为一个更优秀的开发者的10种方式
    Mybatis自动生成实体类
    Maven-SSM项目pom.xml配置以及springmvc配置以及mybatis配置及web.xml配置
    SSM项目layui分页实例
    图书管理系统(毕业论文)
  • 原文地址:https://www.cnblogs.com/name-hanlin/p/4996096.html
Copyright © 2011-2022 走看看