-
Problems with reading from flat file (4 messages)
- Posted by: Whyte Peter
- Posted on: May 17 2003 14:04 EDT
How can I get my web app to read my flat file located in myapp\web-inf directory. Any suggestions would be appreciated.Threaded Messages (4)
- Problems with reading from flat file by SAF . on May 17 2003 16:13 EDT
- Problems with reading from flat file by SAF . on May 17 2003 16:16 EDT
- Problems with reading from flat file by Anil Saldhana on May 19 2003 11:03 EDT
- Problems with reading from flat file by stephen smithstone on May 19 2003 02:20 EDT
- Problems with reading from flat file by SAF . on May 17 2003 16:16 EDT
-
Problems with reading from flat file[ Go to top ]
- Posted by: SAF .
- Posted on: May 17 2003 16:13 EDT
- in response to Whyte Peter
URL url = new URL("http://myApp:80/file.txt);
BufferedReader reader = new BufferedReader( new InputStreamReader( url.openStream()));
String line = "";
StringBuffer buffer = new StringBuffer();
while( (line = reader.readLine()) != null)
buffer.append( line); -
Problems with reading from flat file[ Go to top ]
- Posted by: SAF .
- Posted on: May 17 2003 16:16 EDT
- in response to SAF .
I almost forgot, don't place the file under WEB-INF, place it under the document root, or any subfolder under the document root directory. I don't think you can read files under WEB-INF since they are protected.
SAF -
Problems with reading from flat file[ Go to top ]
- Posted by: Anil Saldhana
- Posted on: May 19 2003 11:03 EDT
- in response to SAF .
SAF, you are right. Files under WEB-INF are protected. -
Problems with reading from flat file[ Go to top ]
- Posted by: stephen smithstone
- Posted on: May 19 2003 02:20 EDT
- in response to SAF .
maybe try to get the root context path of the web application then add WEB-INF to the path and pass to a file object