若依框架将导出的excel直接下载

 
    @GetMapping("/export")
    public void export(HttpServletResponse response,  )
    {
       response.setContentType("application/force-download");
        try {
            response.setHeader("Content-Disposition", "attachment; filename="
                    + URLEncoder.encode("123.xlsx", "UTF-8"));
        } catch (UnsupportedEncodingException e) {

            throw new RuntimeException(e);
        }
        List list = xx.selectHisPurchasePlanList(hisPurchasePlan);
        ExcelUtil util = new ExcelUtil(HisPurchasePlan.class);
        util.exportExcel(response, list, "sheet");
 
    }

你可能感兴趣的:(windows,服务器,linux)