grails-4

Create form for domain object with multiselect Enum field fails with 'Property xxx is type-mismatched'

别来无恙 提交于 2021-02-11 13:00:42
问题 I am using Grails 4.0.4 w/ GORM 7.0.7.RELEASE The database I am using is MongoDB I can successfully run the application and navigate to the create form for the domain class. I can select the value for the singleton field someOtherEnum . I can multiselect values for the categories field. When I submit the form, however, I get this message: 'Property categories is type-mismatched'. I used this approach based on the answers to another question posted here, but it's not working for me. I am not

grails 4 groovy's date enhancement methods missing

只愿长相守 提交于 2021-01-03 05:25:37
问题 In a previous version of grails I was able to use the groovy enhanced version of java.util.Date found here here. After upgrading to grails 4, all those methods throw no signature of method on java.util.Date. Somehow the groovy additions aren't being picked up. def fdate=new Date(); out << fdate.format("MM/dd/yyyy") //No signature of method: java.util.Date.format() 回答1: Add a dependency to groovy-dateutil to your build.gradle : runtime 'org.codehaus.groovy:groovy-dateutil' The relevant

grails 4 groovy's date enhancement methods missing

假装没事ソ 提交于 2021-01-03 05:22:40
问题 In a previous version of grails I was able to use the groovy enhanced version of java.util.Date found here here. After upgrading to grails 4, all those methods throw no signature of method on java.util.Date. Somehow the groovy additions aren't being picked up. def fdate=new Date(); out << fdate.format("MM/dd/yyyy") //No signature of method: java.util.Date.format() 回答1: Add a dependency to groovy-dateutil to your build.gradle : runtime 'org.codehaus.groovy:groovy-dateutil' The relevant

How to get deserialized JTS Geometry field in Grails 4?

爷,独闯天下 提交于 2020-05-13 19:58:51
问题 I'm building a small Geo server using PostgreSQL + PostGIS + Grails 4 + Geoserver + React + JTS. The domain class has a com.vividsolutions.jts.geom.Point field that is maped to a sqlType: 'geometry(Point,4326)' . When I search any findBy...(...) search, I cannot get the result, as it is not posible deserialize in Grails 2.x I did not get this problem. It's my first time programming in Grails in 3 years. package .... import com.vividsolutions.jts.geom.Point class Aqop { String pid String pname

How do I use the Grails environment settings in micronaut client @Header?

旧城冷巷雨未停 提交于 2020-04-18 03:21:24
问题 I have an environment-specific header property in my Grails application.yml , configured like so: environments: development: apiKey: 'foo' How do I use this setting in a @Header for the micronaut HTTP declarative client? I tried this: // property placeholder resolver seems to interprept 'apiKey' property as 'api-key' @Header(name = 'apikey', value = '${api-key}') but I got this error: io.micronaut.context.exceptions.ConfigurationException: Could not resolve placeholder ${api-key} at io

Grails4 - catching file maxFileSize limit when exceeded on uploading a file

允我心安 提交于 2019-12-14 03:04:26
问题 I would like to catch this exception rather than simply returning a 500 to the end users which is a poor experience, at least in my application. The intention would be to return the user back to the form page with some feedback for them to try again. The current experience is to throw the user back a 500 and the following is printed to the logs; Caused by: org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (157552)