首页 > 解决方案 > 从jsp调用html文件

问题描述

我想从一个jsp文件中调用一个html文件index.html。我尝试通过以下两种方法添加,但它不起作用。

<%@ include  file="C:\Users\vishal.tripathi\Desktop\bio-integration\bio-integration\verify\verify\index.html" %>
<c:import url="file:///C:/Users/vishal.tripathi/Desktop/bio-integration/bio-integration/verify/verify/index.html" />

任何人都可以帮助我在jsp中添加它的方法和确切位置。

标签: htmljspinclude-path

解决方案


你可以试试这个将html调用到jsp中,你只需要改变url中的路径,我推荐你使用相对路径。

 <c:import var="html" url="${file.name}.html" />
 <c:out value="${html}" escapeXml="false" />

推荐阅读