1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
response.setHeader("Cache-Control", "no-cache");
File f=new File(c:/monfichier.xml);
response.addHeader("Content-disposition", "attachment; filename=" +f.getName());
ServletOutputStream out = response.getOutputStream();
FileInputStream in=new FileInputStream(f);
int b;
while ((b=in.read())!=-1)
{
out.write(b);
}
in.close();
out.close();
RequestDispatcher rd = getServletContext().getRequestDispatcher("/MainMyApplications1.jsp?page="+numPage);
rd.forward(request, response); |
Partager