Hi,

I'm trying to put an image into a page based on the outcome of an expression. I've tried the following:

<h:graphicImage url="#{(authentication.role == "admin' ? 'image1.gif' : 'image2.gif'}" />

but unfortunately, this doesn't work (the whole expression is passed verbatim to the rendered html), so now I'm resorting to

<h:graphicImage url="image1.gif" rendered="#{authentication.role == 'admin'}" /> <h:graphicImage url="image2.gif" rendered="#{authentication.role != 'admin'}" />

However, the above feels clumsy. Is this the right way to do it, or should the first option work and did I encounter a bug? Any hints appreciated!

(Using stock MyFaces 1.0.9 with JBoss 4.0.2 on Win2k)

--
Patrick Hubers

Reply via email to