本文介绍了在JSP页面中显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello Everyone,
我只是一个struts的新手,我想在JSP页面上显示一个图像,但是我无法让它显示出来图片。
我试图将文件夹中的图像包含在 Web Content 文件夹中,但它没有用,我试着把它放进去在 WEB-INF 文件夹中,但它仍然无法正常工作。
有人可以帮我吗?
这是我在JSP页面中放置的图片标签。
Hello Everyone,
I'm just a newbie with struts and I want to display an image onto JSP pages, but I can't make it display the image.
I tried to put the folder contain the images in "Web Content" folder but it didn't work and I tried to put it in "WEB-INF" folder, but it still didn't work.
Could anyone help me please?
This is the image tag i put in JSP page.
<img alt="logo" src="/resources/images/header.jpg"/>
感谢您的评论
CK
Thanks for any comment
CK
推荐答案
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<img alt="logo" src="<html:rewrite page='/resources/images/header.jpg'/>" width="100%" height="20%"/>
这篇关于在JSP页面中显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!