• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help writing to a text file

 
Thomas Knight
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an hTML page that calls my JSP. The HTML page has textfields for the user to enter the data. The JSP stores these values and then writes them to a text file. This is where I am having a problem. When it writes to teh textfile, it seems to overwrite all the data already in the textfile. I need it to append the text to the end of the file while preserving the original contents.
Here is my code used to communicate with teh external file...

Thanks.
 
Michael Zalewski
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the append flag in the constructor to FileWriter.
 
Thomas Knight
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! Thats exactly what I was looking for.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!