aspose file tools
The moose likes Other Application Frameworks and the fly likes Grails custom error messages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Grails custom error messages" Watch "Grails custom error messages" New topic

Grails custom error messages

Mark Herschberg

Joined: Dec 04, 2000
Posts: 6037
I'm trying to create a custom login error message but clearly I'm missing something. Here's what I have:

The check for uniqueness does work as expected. But I wanted to change from the default message default.not.unique.message in i18n/ to my own message. I added the following line:

as explained at
But it still seems to be using the default message Property [username] of class [class User] with value [mark1] must be unique.

Any ideas?

Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

The documentation says: Error message code: className.propertyName.unique

Your message entry should look like:
user.username.unique=Username {2} already taken.

A good workman is known by his tools.
Mark Herschberg

Joined: Dec 04, 2000
Posts: 6037
Thanks. It's strange that the default messages don't follow the same format.

I agree. Here's the link:
subject: Grails custom error messages
It's not a secret anymore!