1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String type = request.getParameter("type");
Recherche rechercheToExport = (Recherche) request.getSession().getAttribute(Property.SESSION_RECHERCHE);
if ("csv".equals(type)) {
rechercheToExport.createCSVFile();
String csv = Property.getAbsolutePath(Property.PROJECT_FILE, Property.EXPORT_CSV_ZIP).replace("//", "/");
File f = new File(csv);
response.setContentType("multipart/zip");
response.setHeader("Content-Disposition", "attachment; filename=\"" + f.getName().trim() + "\";");
response.setContentLength((int)f.length());
} else if ("ldif".equals(type)){
rechercheToExport.createLDIFFile();
//a faire
} else {
//arg1.
}
//getServletContext().getRequestDispatcher("/jsp/recherche.jsp").forward(request, response);
} |
Partager