I'm trying to output text, to a file named bob.txt, using a jsp form input page. However, everytime a new form is submitted I need to add a new text line to bob.txt. Everything I try seems to just overwrite the same line over and over.
I have tried inserting a \n into my string but it still does the same thing...
Help?
Code:
string imp="text to be output";
PrintWriter pw = new PrintWriter(new FileOutputStream(nameOfTextFile));
pw.println(imp);
pw.flush();
pw.close();
I have tried inserting a \n into my string but it still does the same thing...
Help?