I currently use Apache POI. For the development of my application I used the method proposed in most tutorials.
public void generateExcel() {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("ma feuille");
HSSFRow row = sheet.createRow(0);
HSSFCell cell = row.createCell((short)0);
cell.setCellValue(10);
row.createCell((short)1).setCellValue(20);
FileOutputStream fileOut;
try {
fileOut = new FileOutputStream("monfichier.xls");
wb.write(fileOut);
fileOut.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
But for further development, I need to be able to download the file and not just to create in a directory. I watched a little HttpServletRequest but I am completely lost.
Thank you in advance!