Servlet-how to read a file from servlet
Posted on 2000-05-08
The following code is in a servlet file named "Display.java" (it is called from the doGet() method). The file that I want to read in from Display.java named "test.html". Both of them are in the same directory. But I always got an IOException. Is this a correct way to read in a file from servlet? if not, can you post a piece of code that works or just a suggestion!
thanks in advance,
RandomAccessFile raf = null;
//try to read in a file to parse
raf = new RandomAccessFile("test.html", "r");
//I have IOException here