Grails: How to combine domain objects' errors with command objects' errors?

前端 未结 3 760
日久生厌
日久生厌 2021-02-05 17:06

Suppose I have User domain class and RegistrationCommand class. So when user is registering on website there are two steps for data validation:

  1. RegistrationCommand
3条回答
  •  自闭症患者
    2021-02-05 17:51

    You could probably use the reject mechanism, i.e.

    domainObjects.errors.each{
         commandObject.errors.reject( ... )
    }
    

    http://grails.org/doc/1.3.7/ref/Domain%20Classes/errors.html

提交回复
热议问题