application、session和request的计数器

来源:互联网 发布:数据分析师难考吗 编辑:程序博客网 时间:2024/06/06 00:04

session计数器:

    <%    Integer counter=(Integer)session.getAttribute("counter");    if(counter==null){    counter=1;    }else{    counter++;    }        session.setAttribute("counter", counter);    String realpath=application.getRealPath("/");    String counter = session.getId();</span>     %>     当前页面初访问的次数:<%=counter %><br>     SessionID:<%=counter %>

application计数器:

    <%    Integer counter=(Integer)application.getAttribute("counter");    if(counter==null){    counter=1;    }else{    counter++;    }        application.setAttribute("counter", counter);    String realpath = application.getRealPath("/");     %>     当前页面初访问的次数:<%=counter %>


0 0
原创粉丝点击