【发布时间】:2013-12-17 15:05:15
【问题描述】:
我们最近从 2.2.3 升级到 2.3.3,现在无法从 messages.properties 中获取命令验证失败的错误消息。
如此处所述:http://grails.org/doc/latest/guide/validation.html 我将错误代码更新为末尾没有 .error。
这是我的命令:
@Validateable
class GroupCommand {
String name
static constraints = {
name blank: false, unique: true
}
这是 grails-app/i18n/messages.properties 中的条目:
groupCommand.name.blank=Please enter a name for that group
这是验证失败时我收到的错误消息:
Property [name] of class [class au.edu.rmit.its.iim.googlegrey.GroupCommand] cannot be null
我尝试添加完整的包描述,添加 .error,以及所有组合,并且此消息未被验证接收。
我可以使用消息标签获取它们,但验证系统找不到它们。
有没有人为此找到解决方法,还是我做错了什么?
【问题讨论】:
-
您是否尝试过注释掉在
messages.properties中为blank约束提供的默认消息?
标签: validation grails