I work with internationalization in my webapp and I want reuse some messages again.
faces-config.xml
<locale-config>
<default-locale>en</default-locale>
<supported-locale>uk</supported-locale>
</locale-config>
<resource-bundle>
<base-name>international.message-labels</base-name>
<var>msgLabel</var>
</resource-bundle>
Message from resource bundle
inputLength=Length should be {0} or more
Example:
<p:inputText id="firstName" value="#{user.firstName}"
placeholder="#{msgLabel.namePlaceHolder}" size="25" required="true"
styleClass="logRegLabel" validatorMessage="#{msgLabel.inputLength}"
requiredMessage="#{msgLabel.fieldCannotEmpty}">
<f:param value="3" />
<f:validateLength minimum="3" />
<p:ajax event="blur" update="firstNameMsg" global="false" />
</p:inputText>
In all examples that I saw it works. But in my case I always got Length should be {0} or more
instead of Length should be 3 or more
I tried this validatorMessage="#{msgLabel['inputLength']}"
too
Also, I tried to delete all another parameters of p:inputText
but it did not help