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){