File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP 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.

Consider Paul's rocket mass heater.
subject: Grails custom error messages