zoukankan      html  css  js  c++  java
  • 网站小功能——人数纪录【流量记录】

    这个功能很简单,但是想起来很方便,很久没用忘记了又会很麻烦,所以做一个记录

    count.jsp

    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
    <html>
    <head>
        <title>Title</title>
    </head>
    <body>
    <%
        String pageName=request.getParameter("pageName");
        Integer count=(Integer)application.getAttribute(pageName);
        if (count==null){
            count=new Integer(0);
        }
        count =new Integer(count.intValue()+1);
        application.setAttribute(pageName,count);
        out.println("页面"+pageName+"的访问次数:"+count);
    %>
    </body>
    </html>

    page1.jsp

    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
    <html>
    <head>
        <title>Title</title>
    </head>
    <body>
    <jsp:include page="count.jsp">
        <jsp:param name="pageName" value="page1"/>
    </jsp:include>
    </body>
    </html>
  • 相关阅读:
    Nim or not Nim? hdu3032 SG值打表找规律
    Maximum 贪心
    The Super Powers
    LCM Cardinality 暴力
    Longge's problem poj2480 欧拉函数,gcd
    GCD hdu2588
    Perfect Pth Powers poj1730
    6656 Watching the Kangaroo
    yield 小用
    wpf DropDownButton 源码
  • 原文地址:https://www.cnblogs.com/hahayixiao/p/14551045.html
Copyright © 2011-2022 走看看