title: Create a text file for download on the fly with Java
body: <p>I have a Java Servlet that generates randomly thousands of Strings every time is called. I want the user to be able to get them in a file when he calls the Servlet. I don't want to write first the file on disk or memory.
  Is there a way to write the file on the fly when the user calls the servlet?
  Thanks</p>