jsp計(jì)數(shù)器代碼
JSP-Hitcounter counts sessions.
Copyright (C) 2000 Jesper Schmitz Mouridsen.
Visit www.webappcabaret/jsm2/webapps.jsp?find=jsphcs for more info.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License at http://www.opensource.org/licenses/gpl-license.html for more details
-->
<%
BufferedReader inf = new BufferedReader(new FileReader("/path/to/counter.txt"));
int tmp = Integer.parseInt(inf.readLine());
int i=0;
try {
i = Integer.parseInt(request.getSession().getValue("tal").toString());
} catch (NullPointerException t) {i=0; }
if (i==0) {
tmp++;
PrintWriter outf = new PrintWriter(new BufferedWriter(new FileWriter("/path/to/counter.txt")));
outf.println(tmp);
outf.close();
inf.close();
request.getSession().putValue("tal", "1");
}
BufferedReader inf2 = new BufferedReader(new FileReader("/path/to/counter.txt"));
%>
<%
String zeroes="";
String hits = inf2.readLine();
inf2.close();
for (int t=0; t < 8-hits.length(); t++) {
zeroes=zeroes+"0"; }
out.println(zeroes + hits);
%>
- 一個(gè)簡(jiǎn)單的網(wǎng)站訪問(wèn)JS計(jì)數(shù)器 刷新1次加1次訪問(wèn)
- js計(jì)數(shù)器代碼
- JavaScript實(shí)現(xiàn)計(jì)數(shù)器基礎(chǔ)方法
- 使用JavaScript制作一個(gè)簡(jiǎn)單的計(jì)數(shù)器的方法
- jsp網(wǎng)頁(yè)計(jì)數(shù)器實(shí)現(xiàn)示例
- javascript下計(jì)數(shù)器每秒自動(dòng)加1
- 一個(gè)可以防止刷新的JSP計(jì)數(shù)器
- jsp計(jì)數(shù)器制作
- 用JAVASCRIPT幫我寫個(gè)計(jì)數(shù)器
- 原生js實(shí)現(xiàn)寬度計(jì)數(shù)器
相關(guān)文章
AJAX 自學(xué)練習(xí) 無(wú)刷新提交并修改數(shù)據(jù)庫(kù)數(shù)據(jù)并顯示
對(duì)應(yīng)在數(shù)據(jù)庫(kù)中表格 rocars表的msg_id,ccrn兩個(gè)字段?,F(xiàn)在要實(shí)現(xiàn)在界面上修改ccrn的值,ajax提交到response.jsp頁(yè)面,并調(diào)用RocarsEntiy.updateCcrn方法更新對(duì)應(yīng)的ccrn,最后無(wú)刷新顯示2009-09-09
jsp的注釋可能會(huì)影響頁(yè)面加載速度讓代碼扔繼續(xù)執(zhí)行
注釋里面的java代碼還是會(huì)得到執(zhí)行,可以再查看頁(yè)面源代碼上看到執(zhí)行完成的內(nèi)容2014-10-10
JSP Servelet 數(shù)據(jù)源連接池的配置
在高版本的Tomcat中有的可以省略第2步,有的則不能,如果不能則會(huì)引發(fā)異常,找不到驅(qū)動(dòng)類2009-07-07
jsp request.getParameter() 和request.getAttribute()方法區(qū)別詳解
這篇文章主要介紹了jsp request.getParameter() 和request.getAttribute()方法區(qū)別詳解,本篇文章通過(guò)簡(jiǎn)要的案例,講解了該項(xiàng)技術(shù)的了解與使用,以下就是詳細(xì)內(nèi)容,需要的朋友可以參考下2021-08-08
java易懂易用的MD5加密(可直接運(yùn)行) (1)
出于安全考慮,網(wǎng)絡(luò)的傳輸中經(jīng)常對(duì)傳輸數(shù)據(jù)做加密和編碼處理,其中涉及以下幾種2008-11-11
jsp頁(yè)面中表達(dá)式語(yǔ)言中的$符號(hào)不起作用的解決方法
下面小編就為大家?guī)?lái)一篇jsp頁(yè)面中表達(dá)式語(yǔ)言中的$符號(hào)不起作用的解決方法。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-10-10
JSP 自定義標(biāo)簽實(shí)現(xiàn)數(shù)據(jù)字典的實(shí)例
這篇文章主要介紹了JSP 自定義標(biāo)簽實(shí)現(xiàn)數(shù)據(jù)字典的實(shí)例的相關(guān)資料,這里實(shí)現(xiàn)這樣的功能,希望能幫助到大家,需要的朋友可以參考下2017-08-08
JSP實(shí)現(xiàn)簡(jiǎn)單人事管理系統(tǒng)
這篇文章主要為大家詳細(xì)介紹了JSP實(shí)現(xiàn)簡(jiǎn)單人事管理系統(tǒng),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2019-01-01

