How can I render a <p:graphicImage>
only if the resource URL is valid?
<p:graphicImage url="#{resource['images/image.png']}" />
Basically, I would like to render my graphicImage only if #{resource['images/image.png']}
actually exists. How can I validate this? I tried to follow this JavaScript example, but I didn't succeed.
Check if
ResourceHandler#createResource()
doesn't returnnull
.Note that I replaced
url="#{resource['resourceName']}"
by a much simplername="resourceName"
.I don't use url, rather combination of name and library...
This works for me .... Hope it helps