jsf <f:selectItems> itemVale and message bundle question
I have a form with a combo box populated like this:
<f:selectItems value="#{prog开发者_如何学GoramHandler.validLanguages}"
var="languageConstant"
itemLabel="#{languageConstant.value}"
itemValue="#{languageConstant}" />
I also have a message bundle defined:
<f:loadBundle basename="MessageResource" var="msg" />
My question is, my problem is the languageConstant.value returns a key from the database, for example LANG_ENGLISH, and I want to display the text value from the message bundle.
How do I do this? For example, I guess I'm looking for something like this:
itemLabel="#{msg.[languageConstant.value]}"
Any help is greatly appreciated!
You're close. It's
itemLabel="#{msg[languageConstant.value]}"
精彩评论