Helpful Information
 
 
Category: Java Help
Writing to text files with JSP

I am trying to learn how to write to text files in a JSP file, but am having problems.

First, the server spec's

JServ v1.1.2
Java V1.1.8
FreeBSD

I have tried to grasp what I could from the book on JSP that I have, as well as this, sun's java site, and others.

Here is a snip of the code that I have but together:

try
{
File datafile = null;

datafile = new File("data.txt");

PrintWriter dataout = new PrintWriter(new FileWriter(datafile));

dataout.println(username);
}
catch(IOException ioExc)
{
out.println("error writing file");
}

I would really appreciate any suggestions on where to find more info on the problem if anyone knows. A tutorial on writing to text files would really be great. I have not found one, but maybe someone else has.

Thanks for any suggestions!
-Zach

im not 100% sureo n how much help it is , but if you want to you can use my http://www.geocities.com/sjvsch/IO.html[/url] class that i use for file IO










privacy (GDPR)