• 2021.4.20


    实验2:

    success:

    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>实验2</title>
    </head>
    <body bgcolor="#FFFFFF">
    <center>
    <h1 style="green"> 登录成功! </h1>
    <%
    request.setCharacterEncoding("GBK");
    String name=request.getParameter("name");
    String pwd=request.getParameter("pwd");
    %>
    登录的用户名为: <%=name%><br>
    登录的密码为: <%=pwd %><br>
    <%! Integer yourNumber=new Integer(0); %>
    <% if(session.isNew()){
    Integer number=(Integer)application.getAttribute("Count");
    if(number==null) {
    number=new Integer(1);
    }
    else {
    number=new Integer(number.intValue()+1);
    }
    application.setAttribute("Count", number);
    yourNumber=(Integer)application.getAttribute("Count");
    }%>
    欢迎访问本站,您是第 <%=yourNumber %>个访问用户。
    </center>

    </body>
    </html>

    judge:

    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>实验2</title>
    </head>
    <body bgcolor="#FFFFFF">
    <center>
    <h1>登陆</h1>
    <%
    request.setCharacterEncoding("gbk");
    String name=request.getParameter("name");
    String pwd=request.getParameter("pwd");
    if(name!=null&&pwd!=null&&name.equals("123456")&&pwd.equals("111111")) {%>
    <jsp:forward page = "success.jsp"/>
    <%
    }
    else{
    response.sendRedirect("fail.html");
    } %>
    </center>

    </body>
    </html>

  • 相关阅读:
    微服务简介
    docker跨主机通信扁平化网络的设计与实现
    docker学习ppt
    docker原理介绍
    我的博客搬家啦
    响应式之像素和viewport
    换行+省略号
    ITerms2在mac系统下的安装和配色,并和go2shell关联
    利其器之webstorm快捷键
    React入门 (2)—实现微博展示列表
  • 原文地址:https://www.cnblogs.com/SirNie/p/14908896.html
Copyright © 2020-2023  润新知