如何在 JSPF 文件中包含图像标签
我希望将图像包含在“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 它不起作用...任何人都可以帮我...???
这是我的文件目录的屏幕截图
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用
您必须将文件扩展名指定为 .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 .jspfor you can use
<%@ include file="...." %>
instead of the jsp:include ..尝试使用相对路径,
因为您的图像文件夹比您的 jspf 文件高一级。查看此链接 。
Try a relative path
since your images folder is one level above your jspf file . Check out this link .