Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/372.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用jsp在spring中的下载属性_Java_Spring_Jsp - Fatal编程技术网

Java 如何使用jsp在spring中的下载属性

Java 如何使用jsp在spring中的下载属性,java,spring,jsp,Java,Spring,Jsp,我正在jsp中使用下载属性,但无法下载文件。请让我知道我的问题 <div> <p><h3><b>Download EMPLOYEE DOCUMENT LIST :</b></h3></p> <c:forEach items="${documentList}" var="doc"> <h4><u>&l

我正在
jsp
中使用下载属性,但无法下载文件。请让我知道我的问题

          <div>
          <p><h3><b>Download EMPLOYEE DOCUMENT LIST :</b></h3></p>
          <c:forEach items="${documentList}" var="doc">
          <h4><u><a href="${doc.path}" download>${doc.docName}</a></u></h4>
          </c:forEach>
          </div>

下载员工文档列表:


现在,我要点击链接。没有文件获取失败。

请添加更多代码,初始JSP是正确的。您对从数据库获取PDF文件的方法有问题。您可以发布错误/stacktrace吗?另外,您处理下载的方法?下载错误是:失败-网络错误重试{byte barr[]=file.getBytes();BufferedOutputStream bout=new BufferedOutputStream(new FileOutputStream(path+“/”+filename));//multipartFile.transferTo(new file(saveDirectory+filename));//fileNames.add(filename);bout.write(barr);bout.flush();bout.close();}catch(异常e){