@RequestMapping("downloadTemplate")
public void downloadTemplate() throws IOException{
InputStream in = null;
OutputStream out = null;
try {
this.getResponse().reset();
this.getResponse().setContentType("application/x-msdownload");
this.getResponse().setHeader("Content-Disposition", "attachment;filename="+new String("投标清单模板.xls".getBytes("gb2312"), "ISO8859-1" ));
in = new FileInputStream(this.getRequest().getServletContext().getRealPath("/")+File.separator+"jsp"+File.separator+"model"+File.separator+"模板.xls");
out = this.getResponse().getOutputStream();
//写文件
int b;
while((b=in.read())!= -1){
out.write(b);
}
} catch (Exception e) {
e.printStackTrace();
}finally{
in.close();
out.close();
}
}