<! --
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 participant 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 );
%>