File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Validation in JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Validation in JSF" Watch "Validation in JSF" New topic

Validation in JSF

sri pathi

Joined: Jul 15, 2008
Posts: 28
Is there a way to override the default validation error message that comes with JSF other than writing custom validators?!
For eg. the below code displays "Validation Error: Value Required" as a validation messsage. I would like to use the same validator but change the error message. I'm using RAD 7

Please let me know if this is possible at all.

Thanks in advance!
Venkat Sadasivam
Ranch Hand

Joined: May 10, 2008
Posts: 139
Yes, you can.

Here is an example:
<h:inputText value=�#{bean.value}� requiredMessage=�#{appBundle.requiredMessage}� converterMessage=�#{appBundle.converterMessage}� validatorMessage=�#{appBundle.requiredMessage}�>

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand. ”<br>
-Martin Fowler
I agree. Here's the link:
subject: Validation in JSF
jQuery in Action, 3rd edition