JSF2.0 Finding resource library file attachments

How to link a file inside a subfolder of an image library with JSF2.0?

JSF2.0 Image subfolder

I tried many ways using the library tag and name, but the one that seems to be most logical is the one below, but it does not work!

<h:graphicImage library="images" name="Mecearia\4382982_med.jpg"/>

The server always returns

WARNING: JSF1064: Unable to find or serve resource, Mecearia\4382982_med.jpg, from library, images.

How can i solve this?

+5
source share
1 answer

URL separator /, not \.

<h:graphicImage library="images" name="Mecearia/4382982_med.jpg"/>

By the way, you are not using the librarycorrect path. It must be a "theme", rather than duplicating what has already been said tag <h:graphicImage>(and <h:outputScript>, and <h:outputStylesheet>). If you do not have them (thus only the default theme), delete it and use

<h:graphicImage name="images/Mecearia/4382982_med.jpg"/>

See also:

+4
source

All Articles