[功能集锦] 001 - java下载文件
@RequestMapping("/downloadxls.action") public void downloadxls(HttpServletRequest request, HttpServletResponse response) { //获取请求参数 Map<String, Object> params = ParamsUtil.getParams(request); String contextPath = request.getSession().getServletContext().getRealPath(File.separator + "report"); String excelName = xxxxx; String excelFullName = contextPath + File.separator + excelName + ".xls"; InputStream inStream = null, fileInStream = null; ServletOutputStream outStream = null; int byteRead; try { fileInStream = new FileInputStream(excelFullName); inStream = new BufferedInputStream(fileInStream