Wednesday, August 31, 2016

Show error on grails domain class

When saving the a domain class and the data is not saved to the database, we can trace with this code :


if (!myDomainObj.save()) {
   log.warn myDomainObj.errors.allErrors.join(' \n') //each error is an instance of  org.springframework.validation.FieldError    
}

reference : http://stackoverflow.com/questions/4765037/why-doesnt-grails-notify-me-of-error-at-domain-object-saving

No comments:

Post a Comment