This content has been marked as final.
Show 2 replies
-
1. Re: Help with strange JSF <h:messages> behavior
nm-156 Mar 7, 2008 9:33 AM (in response to nm-156)PS - resource-bundle tag is wrapped in an application tag. Thanks.
-
2. Re: Help with strange JSF <h:messages> behavior
nm-156 Mar 7, 2008 11:56 AM (in response to nm-156)A couple of things were causing the problem. I realized that the weird prefix seems to be caused by having my variable markers enclosed by single quotes '{0}' instead of double quotes "{0}". The second thing is that I needed to have the message-bundle entry in the faces config. Finally, I had to override the default validator message keys/values in my message file. So my faces.config now looks like:
<application> <message-bundle>mypackagename.application</message-bundle> </application> <application> <resource-bundle> <base-name>mypackagename.application</base-name> <var>msgs</var> </resource-bundle> </application>
And the message file looks like:javax.faces.component.UIInput.CONVERSION=Invalid entry, not the correct data type javax.faces.component.UIInput.REQUIRED=Value is required javax.faces.component.UISelectOne.INVALID=Value is not a valid option javax.faces.component.UISelectMany.INVALID=Value(s) are not a valid selection javax.faces.validator.NOT_IN_RANGE=Specified attribute is not between the expected values of "{0}" and "{1}" javax.faces.validator.DoubleRangeValidator.MAXIMUM=Value is greater than allowable maximum of "{0}" javax.faces.validator.DoubleRangeValidator.MINIMUM=Value is less than allowable minimum of "{0}" javax.faces.validator.DoubleRangeValidator.TYPE=Value is not of the correct type javax.faces.validator.LengthValidator.MAXIMUM=Value is greater than allowable maximum of "{0}" javax.faces.validator.LengthValidator.MINIMUM=Value is less than allowable minimum of "{0}" javax.faces.validator.LongRangeValidator.MAXIMUM=Value is greater than allowable maximum of "{0}" javax.faces.validator.LongRangeValidator.MINIMUM=Value is less than allowable minimum of "{0}" javax.faces.validator.LongRangeValidator.TYPE=Value is not of the correct type formField1Label=Form Field 1: formField2Label=Form Field 2: formField3Label=Form Field 3: formField4Label=Form Field 4: