如何在 JSPF 文件中包含图像标签

发布于 2024-12-28 16:02:17 字数 739 浏览 2 评论 0原文

我希望将图像包含在“usermenu.jspf 文件中,然后将其包含在主 flat_status.jsp 文件中

        <tr  title="Apply Here">
        <td height="41" style="cursor:pointer"><img src="<%=request.getContextPath()%>/images/user_manager.jpg" width="38" height="41"></td>
      <td height="41" class="leftPanel">Apply Here</td>
    </tr>

我已使用以下标记将 JSPF 文件包含在主 JSP 文件中

 <jsp:include page="WEB-INF/jspf/usermenu.jspf"></jsp:include>

我尝试过这个 bt 它不起作用...任何人都可以帮我...???

这是我的文件目录的屏幕截图

http://imageshack.us/photo/my-images/4/70285685.jpg/

I want to image to be included in "usermenu.jspf file which is then included in main flat_status.jsp file

        <tr  title="Apply Here">
        <td height="41" style="cursor:pointer"><img src="<%=request.getContextPath()%>/images/user_manager.jpg" width="38" height="41"></td>
      <td height="41" class="leftPanel">Apply Here</td>
    </tr>

I have used following tag to include JSPF file in Main JSP file

 <jsp:include page="WEB-INF/jspf/usermenu.jspf"></jsp:include>

I hv tried this one bt it doesnt work...can anyone help me out...???

Here is Screen shot for my files directory

http://imageshack.us/photo/my-images/4/70285685.jpg/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

把回忆走一遍 2025-01-04 16:02:17

如果您使用 您必须将文件扩展名指定为 .jsp 而不是 .jspf

,或者您可以使用 <%@ include file="...." %> 而不是 jsp:include ..

if you are using <jsp:include page="...."></jsp:include> you have to give file extension as .jsp insted of the .jspf

or you can use <%@ include file="...." %> instead of the jsp:include ..

月寒剑心 2025-01-04 16:02:17

尝试使用相对路径,

<img src="../images/user_manager.jpg" 

因为您的图像文件夹比您的 jspf 文件高一级。查看链接 。

Try a relative path

<img src="../images/user_manager.jpg" 

since your images folder is one level above your jspf file . Check out this link .

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文