This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I have a servlet that i use to write a excel file and then send it back to user. So the user can save it or open it in excel. The problem is how do i give a name to this excel file. Because right now, if the user chooses to open the excel file (rather than saving it). It takes the name of the file same as the name of the servlet that was used to create the file...ex : http://localhost:7001/app/CreateExcel.do
Here is the snippet of the servlet . I use POI to create excel file
HSSFWorkbook workBook = CreateExcel.writeMSExcel(list.toArray(), lst); // CreateExcel is my helper class // Write the output OutputStream out = response.getOutputStream(); workBook.write(out); out.flush(); out.close();