This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Grails custom error messages

 
Mark Herschberg
Sheriff
Posts: 6037
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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/messages.properties to my own message. I added the following line:



as explained at http://grails.org/Validation+Reference#ValidationReference-nullable.
But it still seems to be using the default message Property [username] of class [class User] with value [mark1] must be unique.

Any ideas?


--Mark
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The documentation says: Error message code: className.propertyName.unique

Your message entry should look like:
user.username.unique=Username {2} already taken.
 
Mark Herschberg
Sheriff
Posts: 6037
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. It's strange that the default messages don't follow the same format.

--Mark
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic