项目中java 流下载jsp页面没反应,求大神解答,急急急

 @RequestMapping("/download")
    public void downloadFile(HttpServletRequest request, HttpServletResponse response) throws IOException {

        String filePath = ServletRequestUtils.getStringParameter(request, "filePath", ""); //
        String fileName = ServletRequestUtils.getStringParameter(request, "fileName", ""); //
        String destUrl = filePath;

        String fileFormat = filePath.substring(filePath.lastIndexOf("."));
        String name = fileName.trim() + fileFormat;

        // 建立链接
        URL url = new URL(destUrl);
        HttpURLConnection httpUrl = (HttpURLConnection) url.openConnection();
        // 连接指定的资源
        httpUrl.connect();
        // 获取网络输入流
        BufferedInputStream bis = new BufferedInputStream(httpUrl.getInputStream());
//      // 清空response
//      response.reset();
        // response.setContentType("application/x-msdownload");
        request.setCharacterEncoding("UTF-8");
        response.setContentType("application/octet-stream; charset=utf-8");
        response.setContentType("application/force-download");// 设置强制下载不打开
        response.addHeader("Content-Disposition", "attachment; filename=" + java.net.URLEncoder.encode(name, "UTF-8"));
        ServletOutputStream out = response.getOutputStream();
        byte[] buf = new byte[1024];
        if (destUrl != null) {
            BufferedInputStream br = bis;
            int len = 0;
            while ((len = br.read(buf)) > 0) {
                out.write(buf, 0, len);
            }
            br.close();
        }
        out.flush();
        out.close();
    }
不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^