How to save a string to an output file
Posted on 2003-03-19
I have a JSP page that is displaying some information that was got from database. But I would like to get this information and save to an output file.
I created a Utility class that has a method called GenerateFileOutput() that contains the contains bellow:
DataOutputStream outFile = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(theFileName)));
My JSP contains the line bellow:
<% util.GenerateFileOutput("/abc.txt", m_sAllFileContents); %>
My JSP is executed sucessfully, but the output file is not being generated.
Is there another way to do this in JSP?