index.jsp

来自「网络计数器防刷新的」· JSP 代码 · 共 60 行

JSP
60
字号
<%@ page contentType="text/html;charset=GB2312" %>

<HTML><BODY>

<%!

   String show(Integer counter)

   {

       String S, image;

        image = "";

       S = counter.toString() ;

       for(int i = 0; i<S.length(); i++)

       {

            image = image + "<IMG SRC=images/" + S.charAt(i) + ".gif>";
            

       }

       return image;

    }

%>

<%

    Integer number=(Integer)application.getAttribute("Count");

    if(number==null)    { 

         number=new Integer(1);

         application.setAttribute("Count",number); 

    }

    else   { 

         number=new Integer(number.intValue() + 1);

         application.setAttribute("Count",number); 

    }

    %>

您是本站第<%=show((Integer)application.getAttribute("Count"))%>

个访问本站的客户。

</BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?