How to dynamically pass arguments to messages in the resource bundle

Sam picture Sam · Aug 2, 2010 · Viewed 10.6k times · Source

I would like to retrieve the message information from the i18n bundle (messages.properties in seam), but I am not sure how to pass the declare / pass the jobCount variable dynamically in my xhtml

The existing code looks like this.

<s:decorate template="/layout/panel-name.xhtml">
    <ui:define name="label">User has been assigned #{jobCount} jobs</ui:define>
</s:decorate>

Answer

Migol picture Migol · Aug 3, 2010

I think this should work:

<h:outputFormat value="#{msg.yourMessage}">
  <f:param value="#{myBean.jobCount}" />
</h:outputFormat>