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