0

The following dataTable shows "???messageId???" instead of the correct id:

<p:dataTable id="msgTable" var="msg" value="#{msgModel.messages}">
        <p:column headerText="Id">
            <h:outputText value="#{msg.messageId}" />
        </p:column>
</p:dataTable>

After some tedious debugging, I found that it worked when renaming the var to something else than "msg"

<p:dataTable id="msgTable" var="msg2" value="#{msgModel.messages}">
        <p:column headerText="Id">
            <h:outputText value="#{msg2.messageId}" />
        </p:column>
</p:dataTable>

In what context is "msg" a reserved keyword ? I could not find any documentation about it for html, Javascript or JSF ?

Tim
  • 3,910
  • 8
  • 45
  • 80

1 Answers1

2

It's not a reserved keyword.

The name "msg" is however recognizable as the value of <resource-bundle><var> as seen in faces-config.xml of many JSF tutorials and kickoff applications.

<resource-bundle>
    ...
    <var>msg</var>
</resource-bundle>

The error message which you got also confirms it. When a resource bundle message is not found by given key, by default the very same key is returned surrounded with three quesiton marks, exactly as you've observed:

???key???

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555