• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

JSP Text File Help

blare

n00b
Joined
Aug 5, 2005
Messages
8
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.

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?
 
Back
Top