问题
I've followed the steps answered in similar SO questions and also in other sites like Mkyong with no success. I'm describing below what I've done so far in order to customize the javax.faces.component.UIInput.REQUIRED:
Create
MyMessages.propertiesinformularis.utils.missatges.custompackage and customize the error:javax.faces.component.UIInput.REQUIRED = This value is required.Copy
MyMessages.propertiesand translate to my languages:MyMessages.properties MyMessages_ca_ES.properties MyMessages_es_ES.properties MyMessages_en_US.propertiesDeclare the properties file in
faces-config:<application> <locale-config> <default-locale>ca_ES</default-locale> <supported-locale>ca_ES</supported-locale> <supported-locale>es_ES</supported-locale> <supported-locale>en_US</supported-locale> </locale-config> <message-bundle>formularis.utils.missatges.custom.MyMessages</message-bundle> </application>
Am I missing any configuration or declaration? I don't understand why my application doesn't show my custom error messages. Thank you in advance.
来源:https://stackoverflow.com/questions/13799912/error-customizing-validation-error-messages-in-jsf-1-2