tags:

views:

24

answers:

1

I have a JSF page which has a bundle loaded. However I need to dynamiclly build a key to access the property. What I need to do is check that the property exists so I can decide whether to render the or not.

I have tried checking if the value is empty but it always renders the output.

Thanks

A: 

You can write a custom JSTL / Facelets function that takes two arguments - the bundle and the key, and verifies whether the key is contained. Something like:

value="#{cust:containsKey(msg, key) ? msg[key] : 'default'}"
Bozho