I am trying to allow a user to save data from my servlet as a CSV file. Initially, I just found my desktop to delete the file, but permission will be denied using this route, so I want to ask the user where he wants to save it.
From what I see, I cannot use the Swing API in the servlet because Tomcat does not know how to draw a GUI. I tried this code:
String fileName = "ClassMonitor" + formatter.format(currentDate) + ".csv"; File csvFile = new File(fileName);
But this will throw an exception without a header.
Any guidance on how to implement something like a file save dialog in a servlet would be greatly appreciated.
source share