5

How do I reference a file inside the subfolder of the image library with JSF2.0?

JSF2.0 Image subfolder

I have tried many ways using the library and name tag but the most logical seems to be the one below, but it doesn't 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?

Jitesh Pramodray
  • 424
  • 1
  • 7
  • 16

1 Answers1

4

The URL path separator is /, not \.

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

By the way, you're not using library the right way. It should represent a "theme", not a duplication of whatever the <h:graphicImage> (and <h:outputScript> and <h:outputStylesheet>) tag by itself already tells. If you don't have any (thus just the "default" theme), remove it and use

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

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555