0

I'm looking for some help in using the of JSF 2. I want to display an image in a webpage, but the image comes from a resource folder in my project directory structure. The problem is, the webpage doesn't load the image.

Here is my project directory structure

project directory structure

My code to load the image into the webpage

<h:graphicImage library="images" name="captain america.jpg"/>

when I run my code, it doesn't display the image. How can I load my images from a resource folder to the webpage?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
zbryan
  • 805
  • 2
  • 12
  • 24

1 Answers1

-2

Use the value attribute

And image folder should be in root level same as that of web inf

javaworld
  • 427
  • 1
  • 9
  • 19
  • I added the image folder in the web-inf location. web-inf--resources--images, I used the value attribute , but still the image is not being rendered. – zbryan Jun 15 '16 at 03:09