标签:col springmvc pat sep spring ext down body real
@RequestMapping("/downloadTemplate3.action") @ResponseBody public void downloadTemp(HttpServletResponse response,HttpServletRequest request) throws IOException { response.setHeader("Content-Disposition", "attchment;filename="+new String("机顶盒资源模板.xlsx".getBytes("UTF-8"),"iso-8859-1")); ServletOutputStream outputStream = response.getOutputStream(); String file = request.getSession().getServletContext().getRealPath("") + "template" + File.separator + "机顶盒资源模板.xlsx"; FileInputStream inputStream = new FileInputStream(file); IOUtils.copy(inputStream, outputStream); }
标签:col springmvc pat sep spring ext down body real
原文地址:https://www.cnblogs.com/java-diaosi/p/10641626.html