我是关于grails的groovy的新手。我正面临从excelsheet到数据库的问题保存日期。我的约会日期为2014-02-15
。我对config.groovy进行了更改
grails.databinding.dateFormats = ['dd/mm/yyyy','yyyy-MM-dd']
但它仍然会显示错误信息,如
ERROR context.GrailsContextLoader - Error initializing the application: Validation Error(s) occurred during save():
- Field error in object 'org.grails.importexcel.SandyData' on field 'purchaseOrderDate': rejected value [2014-02-15]; codes [org.grails.importexcel.SandyData.purchaseOrderDate.typeMismatch.error,org.grails.importexcel.SandyData.purchaseOrderDate.typeMismatch,sandyData.purchaseOrderDate.typeMismatch.error,sandyData.purchaseOrderDate.typeMismatch,typeMismatch.org.grails.importexcel.SandyData.purchaseOrderDate,typeMismatch.purchaseOrderDate,typeMismatch.java.lang.String,typeMismatch]; arguments [purchaseOrderDate]; default message [Could not find matching constructor for: java.lang.String(org.joda.time.LocalDate)]
Message: Validation Error(s) occurred during save():
任何人都可以为我提供解决方案。
由于