how to display a text file in a html page?
843841Apr 7 2003 — edited Apr 8 2003I have written a servlet that executes a batch file whose output is saved to a txt file. I am attempting to display content of the text file as a html page from the servlet but am struggling I have attempted to read the file and output it as shown below but it is not displaying the correct data
Appreciate some help
Thanks in advance
Amjad
Runtime r = Runtime.getRuntime();
Process p = r.exec("C:\\Condor\\test\\QueStatus.bat");
PrintWriter out;
String title = "Que Status";
response.setContentType("text/html");
out = response.getWriter();
FileReader fr = new FileReader ("C:\\Condor\\test\\output.txt");
for (int chr = fr.read(); chr != -1; chr = fr.read()){
out.print(chr);
}