Image jsf java

0

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:

    
asked by anonymous 27.04.2017 / 03:34

2 answers

1

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" .

    
27.04.2017 / 12:59
1

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

    
02.05.2017 / 19:45