0
I’m using the poi 3.15 library to generate excel on a web system, but I’m having trouble downloading the file, locally it works but when I publish it does nothing. I put it at the beginning like this:
String caminho = System.getProperty("user.home");
String filename = caminho + "/arquivo.xls";
In the end:
try (FileOutputStream fileOut = new FileOutputStream(filename)) {
workbook.write(fileOut);
}
and I call in:
case "EXPORTAR":
new ClasseDAO().exportarExcel(id);
dispatcher = request.getRequestDispatcher("pagina.jsp");
dispatcher.forward(request, response);
break;
The call is in a form action, already tried setting Contenttype with vnd.ms-excel, Header with Attachment but does not work.