Web的Java开发基础分享——学生信息管理系统(三)

代码仓库:https://github.com/KarezaC/StudentsInformationManagerSystem

博主考完试了,继续更新,还不信更不完!!!

在上次学生信息管理系统welcome.jsp页面中,再增加一个功能,使得页面可以实现显示客户为第几个访问该网页的客户。

语句添加后完整的页面代码如下:

<!--这里是welcome.jsp-->
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1.0, 
              minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
        <title>欢迎0.0</title>
    </head>
    <body>
        <h1 align="center">欢迎使用学生管理系统</h1>
        <a href="login.jsp"><h2 align="center">点击进入</h2></a>
        <div align="center" style="width:100%; position:fixed; bottom:0;">
            <%
                int num = 1;
                if (application.getAttribute("Count") == null) {
                    num = 1;
                } else {
                    num = ((Integer) application.getAttribute("Count")).intValue();
                    num++;
                }
                application.setAttribute("Count", new Integer(num));
            %>
            <%="欢迎访问本站," + "您是第" + num + "个访问用户"%>
        <br>
            <%!Date time = new Date();%>
            <%
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒");
            %>
            <% out.println(sdf1.format(time));%>
        </div>
    </body>
</html>

代码没有什么难点,就不做解释啦(心里想着赶紧混完),有同学看不懂的可以评论或者私信哦~

界面显示如下:

接下来,我们完善下上次已经写了表面的数据库删除功能。

评论 19
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Kareza

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值