469,626 Members | 1,148 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,626 developers. It's quick & easy.

How to display data from a text file onto a webpage?

Hi Guys,

Does anyone know how to display data from a text file onto a webpage?

So far I have opened and read the data in the text file and printed it out on command line, but I am having difficulty of displaying the data from the text file on to the webpage.
Feb 7 '07 #1
2 2268
3,652 Expert 2GB
I imagine you could open an output stream to the webpage's document and write everything through this, including all the HTML related tags. The changes would talk effect the next time you loaded the page. I'm not sure though if this is what you require, and I haven't had much experience reading/writing with Java files.
Feb 7 '07 #2
2,476 2GB
the code will be somthing like this in jsp....

import java.io.*;

<%FileReader file = new FileReader("file_name with path");
while((String line = file.readLine()) != null){

plz send me the reply ..
i am online
Feb 8 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Kees de Winter | last post: by
3 posts views Thread by Sharon | last post: by
4 posts views Thread by Mubs | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.