domain.errors.hasErrors() 和 domain.hasErrors() 有什么区别?

What's the difference between domain.errors.hasErrors() and just domain.hasErrors()?

有人可以解释为什么有时 grails 开发人员使用 foo.errors.hasErrors() 而其他时候只使用 foo.hasErrors() 吗?它们是同义词还是一个正确而另一个不正确?

两者是同义词。参见 GormValidationApi.groovy。 Domain.hasErrors 委托给基础 Errors 对象。