How to set a custom message for a standard validator in JSF?

You can register a message bundle and customize those messages. This is a pretty decent example/tutorial:

http://www.mkyong.com/jsf2/customize-validation-error-message-in-jsf-2-0/


To change these values you basically have to define your own Resources file, override the properties you want custom messages for and register it in web.xml. This link seems to explain it well, so I've included this rather than try and rewrite the content.

For a simpler solution and as you are JSF 2 you can also use these attributes of the inputText component:

requiredMessage="I am a custom message"
converterMessage="I am a custom message"
validatorMessage="I am a custom message"

This will override any message which the validator itself spits out.

But I'd prefer the Resource bundle, as that promotes consistency of user visible error messages across your application.