Error customizing validation error messages in JSF 1.2

倾然丶 夕夏残阳落幕 提交于 2019-12-12 03:47:07

问题


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:

  1. Create MyMessages.properties in formularis.utils.missatges.custom package and customize the error:

    javax.faces.component.UIInput.REQUIRED = This value is required.
    
  2. Copy MyMessages.properties and translate to my languages:

    MyMessages.properties
    MyMessages_ca_ES.properties
    MyMessages_es_ES.properties
    MyMessages_en_US.properties
    
  3. Declare 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!