Hi,
I’ve got a code that reads form a text file. (The data is coming from a parallel port every ten minutes, and is getting stored in the text file, every time a new data is read, it overwrites the previous data) this data from the text file is taken by the jsp and displayed onto a browser.
The code I have done, refreshes every 10minutes. The problem is, i don’t no how to save the previous data, so the user will be able to view the last ten data (in the text file)
I have tried putting it in an array, but it doesn’t work, don’t think I’ve done a good job of it. PLEASE SOM1, HELP!!!!!
<HTML>
<HEAD>
<meta http-equiv="refresh" content="600">
<TITLE>The result.....</TITLE>
</HEAD>
<BODY>
<%@ page language = "java" import="java.io.*"%>
<% try
{
String strPath ="W:/www/ee05u041/data.txt";
String j;
for (int i[0]; i[0]<10; i++){
BufferedReader objReader = new BufferedReader(new FileReader(strPath));
i[0]= objReader.readLine ();
j=Integer.parseInt(i[0]);
while (i[0]!= null)
{
out.println(j);
j = objectReader.readLine();
i[0]=j;
}
}
out.println(i[0]);
out.println(i[1]);
catch(IOException e){}
%>
</BODY>
</HTML>
thank you.