I want to put an image on a JSF page, netbeans, but the page does not display the image.
I'm calling the image in my code like this:
<h:graphicImage library="resources/imagens" name="LojaRoupas.jpg"/>
My project structure looks like this:
Remove your pages from the WEB-INF
folder. Leave them inside the Paginas Web
page.
Whereas the LojaRoupas.jpg
file is inside the imagens
folder: in the library
attribute, remove the resources
folder. The resources
folder serves exactly to inform you that what comes down is libraries
.
Leave like this: library="imagens"
.
creates an images directory within resources in WEB-INF and places your image inside it. leave your code like this
<h:graphicImage library="imagens" name="LojaRoupas.jpg"/>
Remember the param library already searches the resources directory directly