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

标签 grails error-handling

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

最佳答案

两者是同义词。请参阅 GormValidationApi.groovy。 Domain.hasErrors 委托(delegate)给底层 Errors目的。

关于grails - domain.errors.hasErrors() 和 domain.hasErrors() 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29291998/

相关文章:

grails - 从gdoc创建PDF

grails - 如何从Grails中正确去除H2

delphi - 如何优雅地退出在 Delphi 中执行代码的 MDI 表单

go - 接口(interface)上的 nil 测试失败

hibernate - java.lang.ClassNotFoundException:org.hibernate.cfg.Mappings

string - 增加VARCHAR的限制

c++ - 错误 : expected unqualified-id before 'void'

error-handling - firebug 显示网络错误

javascript - 在 Nodejs Controller 内使用 Promise

rest - 使用Grails rest插件下载文件时,如何从HTTP header 获取文件名?