When I submit the form, and the fields are not filled out, the following messages are shown: "j_id2:j_id6: Validation Error: Value is required. j_id2:j_id8: Validation Error: Value is required. j_id2:j_id10: Validation Error: Value is required. "
How do I configure the message of each field? I wanted to show something like "It is necessary to input the user name".
The Entity class has the following method:
By the way, the validation message when the user name is not between 5 and 15 characters is working fine.
Hibernate Validator does not enforce the @NotNull annotation. That is taken care of by JSF. The best way to ensure that you get per-field validation messages is to use the <s ecorate> tag along with the layout/edit.xhtml template provided with seam-gen:
Right now, you are probably displaying them at the top of the page using <h:messages/>. Change that to <h:messages globalOnly="true"/>.
To customize JSF messages, you enter the keys in the messages*.properties files. Again, if you create a seam-gen project, you will see the keys that are in these files. Here are the two keys you want: