grails

Grails/Groovy regular expression- how to use (?i) to make everything case insensitive?

那年仲夏 提交于 2021-01-02 05:12:26
问题 I use the following RegEx: url (blank:false, matches: /^(https?:\/\/)(?:[A-Za-z0-9]+([\-\.][A-Za-z0-9]+)*\.)+[A-Za-z]{2,40}(:[1-9][0-9]{0,4})?(\/\S*)?/) I want to add (?i) to make everything case insensitive. How should I add this? 回答1: I can confirm the (?i) at the beginning of the regex makes it case insensitive. Anyway, if your purpose is to reduce the regex length you can use the groovy dollar slashy string form. It allows you to not escape slashes / (the escape char becomes $ ). In

Grails binddata in service

£可爱£侵袭症+ 提交于 2020-11-30 07:35:30
问题 Is there a way to utilize bindData in a service other than using the deprecated BindDynamicMethod ? I can't just use TestObject testObject = new TestObject() TestObject testObject.properties = params or TestObject testObject = new TestObject(params) because I have a custom bind method utilizing the @BindUsing annotation within my TestObject class. 回答1: In Grails 2.4.4 you can do something like this: // grails-app/services/demo/HelperService.groovy package demo import org.grails.databinding

Grails binddata in service

≯℡__Kan透↙ 提交于 2020-11-30 07:35:05
问题 Is there a way to utilize bindData in a service other than using the deprecated BindDynamicMethod ? I can't just use TestObject testObject = new TestObject() TestObject testObject.properties = params or TestObject testObject = new TestObject(params) because I have a custom bind method utilizing the @BindUsing annotation within my TestObject class. 回答1: In Grails 2.4.4 you can do something like this: // grails-app/services/demo/HelperService.groovy package demo import org.grails.databinding

阿里云maven 仓库正确配置姿势

萝らか妹 提交于 2020-10-31 18:53:16
阿里云的maven仓库 地址和 使用文档 阿里云确实好用。 文档 使用方式 <mirror> <id>aliyunmaven</id> <mirrorOf>*</mirrorOf> <name>阿里云公共仓库</name> <url>https://maven.aliyun.com/repository/public</url> </mirror> 这样虽然大部分jar 可以下载下来了。 但是有时候发现还是某些jar 明明在 中央仓库里面maven 就是下载不下来。。。 小孩子才做选择,大人当然是全都要 配置 那就全部配置 进行了 <mirror> <id>public</id> <mirrorOf>public</mirrorOf> <name>阿里云公共仓库</name> <url>https://maven.aliyun.com/repository/public</url> </mirror> <mirror> <id>central</id> <mirrorOf>central</mirrorOf> <name>阿里云公共仓库</name> <url>https://maven.aliyun.com/repository/central</url> </mirror> <mirror> <id>google</id> <mirrorOf>google</mirrorOf>