0

How do I create a custom validator with a custom error message in Grails?

here says how created its message about error for validator. how to create its message about error for the standard validator?

thank and sorry for my English

Community
  • 1
  • 1

1 Answers1

0

Take a look here:

[Class Name].[Property Name].[Constraint Code]

For example you've provided, it'll be in i18n file:

personSignUpCommand.password.blank = First name should not be blank

Also you can see in debug all codes for validation error. Just call validate() check errors property of domain instance.

Mr. Cat
  • 3,522
  • 2
  • 17
  • 26