Generate csv file on a button click
I have a web page where a user can choose a group name, and then he's sent to another jsp where I display members for the chosen group based on a query result. I want the user to be able to click on a button that will let him save the result as csv file. I tried to create the file when the jsp loads; however, there was a problem when more than one user clicked on the button at the same time, because the file was getting overwritten and only one user was getting file with the right result. When 100 users click on the button, I don't want to save 100 files to the server. Is there any efficient way to do it?