简体   繁体   English

graphicImage不使用jsf和primefaces收费

[英]graphicImage does not charge using jsf and primefaces

I am trying to make an image appear in a project using primefaces. 我正在尝试使图像使用Primefaces出现在项目中。 I am using graphicImage but when i run the program, the image does not appear correctly. 我正在使用graphicImage,但是当我运行程序时,图像无法正确显示。 I have the image in a resoure folder, and in the WEB-INF folder 我在resoure文件夹和WEB-INF文件夹中都有图像

I am using this code: 我正在使用此代码:

       <p:graphicImage value="image1.png" rendered="true"/>

If your image is inside the resources folder you need to point to it: 如果图像位于资源文件夹中,则需要指向它:

<p:graphicImage value="/resources/image1.png" />

Even better if you create a folder named images inside the resources folder, to keep it nice and clean like this: 如果在resources文件夹中创建一个名为images的文件夹,则更好的做法是使它保持美观整洁,如下所示:

<p:graphicImage value="/resources/images/animation-iris-small.gif" />

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM