我在我的应用程序中使用了primefaces4、jsf2.0和tomcat6。我正在使用<p:clientValidator event="blur">
。我需要修改错误消息,例如"Number: Validation Error: Value is required“。如果字段为空,它将变得模糊,但我想将其修改为"Number is required“。其中"Number“是字段的标签。我已经在我的资源包文件"javax.faces.component.UIInput.REQUIRED={0} is Required“中尝试过了,但仍然显示旧消息"javax.faces.component.UIInput.REQUIRED={0} is Required”。请告诉我我应该在哪里修改消息。
抱歉,如果有任何错误,我是一个新的蜜蜂在jsf。提前感谢
发布于 2014-01-31 12:01:47
1)创建您的validation.properties文件版本(根据需要重命名)
2)在该文件中添加javax.faces.component.UIInput.REQUIRED={0} is Required
行。
3)在faces-config.xml中注册属性文件
<application>
<message-bundle>your.path.here.validation</message-bundle>
</application>
有关更多信息,请参阅链接Customize validation error message in JSF 2.0
https://stackoverflow.com/questions/21456674
复制相似问题