In my Grails application, I need to bind the request parameter to the field Dateof the command object. To perform a String-to-Date conversion, you must register the corresponding PropertyEditor ingrails-app\conf\spring\resources.groovy
I added the following bean definiton:
import org.springframework.beans.propertyeditors.CustomDateEditor
import java.text.SimpleDateFormat
beans = {
paramDateEditor(CustomDateEditor, new SimpleDateFormat("dd/MM/yy"), true) {}
}
But I still get the error message:
java.lang.IllegalArgumentException: Could not parse date: Unparseable date: "04/01/99"]
I think that maybe something is wrong with how I defined the bean, but I have no idea what?
source
share