i do not remember the specifics, but i will try and help.
use the IO class. there should be methods there which will create a file, and methods which will write to it or append to it.
i wish i had some code to give you, but it is on my laptop which i do not have access to right now.
oh, one place i think is great is java.sun.com, click on jsdk1.4 and then the api for it. you will have a listing of all the classes. go to the io class and
you should have everything you need.
you may have to save the file on the server pc? i am not sure if you could directly send it to the client. but you could have a link in a .jsp indicating the file has been made and have a link to the txt file, then the person should be able to download it if they need it.