Grails 2.0.1 doesn't like java.util.Date

I upgraded from Grails 2.0 to 2.0.1 and started getting this error. Any ideas what broke and how to fix it?

... The [getTransactionData] action takes a parameter of type [java.util.Date], which is not a class of the command object. This can happen if the source code for this class is not in this project and the class is not marked with the @Validateable symbol.

+4
source share
2 answers

I had a similar problem for a helper method in my controller. Is your getTransactionData helper method? In my case, the problem was solved by changing the method to private, since all public methods are considered as controller actions in Grails 2.0.1+.

Credit, which should be a loan: Jeff Brown answers nabble, although he did not fix the problem for the original question, cured it for me: http://grails.1312388.n4.nabble.com/Grails-2-0-1- strange-behavior-td4390405.html .

+4
source

Do you use command object in src / groovy? You will need to annotate it with @Validateable - add import for grails.validation.Validateable .

0
source

Source: https://habr.com/ru/post/1399235/


All Articles