I am writing a Grails application (2.3.3 at present) and have created a valid command object similar to the following:
@Validateable
class MyCustomCommand {
String name
static constraints = {
name blank: false
}
}
In my i18n/messages.propertiesfile, I defined the following properties to override the default error messages.
MyCustomCommand.name.blank=Name must be provided.
MyCustomCommand.name.null=Name must be provided.
There should be a format for every Grails documentation [Class Name].[Property Name].[Constraint Code], as I already did. When I run my application, if I leave the value empty, I still get the default message for the null property.
I also tried to run the sample default messages and define them as follows, but still get the default message.
MyCustomCommand.name.blank.message=Name must be provided.
MyCustomCommand.name.null.message=Name must be provided.
I assume that here I have missed something simple, but have not yet stumbled upon what. Any suggestions on what I'm doing wrong?