Java jsf image

Asked

Viewed 804 times

0

I am wanting to place an image on a netbeans JSF page, but the page does not display the image.

I’m calling the picture in my code like this:

<h:graphicImage library="resources/imagens" name="LojaRoupas.jpg"/>

My project structure is like this:

inserir a descrição da imagem aqui

  • Dude, try removing your xhtml pages from the WEB-INF folder.

  • I removed the pages from WEB-INF but still the same error

2 answers

1

creates a directory images within Resources in WEB-INF and puts your image inside it. leaves your code like this

<h:graphicImage library="imagens" name="LojaRoupas.jpg"/>

Remember the param library already looks straight in the directory Resources

1


Remove your pages from the folder WEB-INF. Leave them inside the page Paginas Web.

whereas the archive LojaRoupas.jpg is inside the folder imagens: in the attribute library remove the folder resources. The briefcase resources serves exactly to inform that what comes below are libraries.

Leave it at that: library="imagens".

  • I tidied up my project structure as you said but continues the same mistake

  • Changed the content of the attribute library also?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.