Java Reference
In-Depth Information
Error message keys follow the pattern keyname for summary errors and
keyname_detail for detailed errors. If there is no detailed error message for a
specific error, the default is to use the summary message for the detailed message
as well. This is exactly what is happening in our case. Messages.properties only
specifies a summary error message for required validation errors.
Looking at Messages.properties , we can infer that the key for the required
validation error is javax.faces.component.UIInput.REQUIRED , therefore we need
to add a javax.faces.component.UIInput.REQUIRED_detail key to our property
file. While we are at it, we can add a user-friendlier summary validation message.
To modify our property file, we can either right-click on it and select Edit to open it
in a text editor, or right-click on it and select Open to open it in NetBeans' property
file editor. After choosing the second approach and adding the appropriate keys and
values, the property file editor should look something like this:
 
Search WWH ::




Custom Search