grails-3.0

Installing and using MongoDB in Grails 3.x

自作多情 提交于 2019-12-01 08:00:59
I've been following Manning's Grails In Action , but their section on configuring data sources is woefully out-of-date for Grails 3.0.3. My intention is to convert from the default data source of H2 to MongoDB version 3.0.2. Google searches have yielded conflicting results -- many answers are often for earlier versions of Grails, which used 'BuildConfig.groovy' and 'DataSources.groovy' in order to establish plug-ins and data sources. I've downloaded the 3.0.2 JDBC for MongoDB and stored it in various folders (i.e. the root of the application, a created /lib/ folder, and in /grails-app/conf/)

Installing and using MongoDB in Grails 3.x

↘锁芯ラ 提交于 2019-12-01 07:10:45
问题 I've been following Manning's Grails In Action, but their section on configuring data sources is woefully out-of-date for Grails 3.0.3. My intention is to convert from the default data source of H2 to MongoDB version 3.0.2. Google searches have yielded conflicting results -- many answers are often for earlier versions of Grails, which used 'BuildConfig.groovy' and 'DataSources.groovy' in order to establish plug-ins and data sources. I've downloaded the 3.0.2 JDBC for MongoDB and stored it in

Grails 3 - change default port for run-app

拟墨画扇 提交于 2019-11-30 07:21:51
问题 In Grails3 grails -Dserver.port=9001 run-app doesn't appear to work: I'm "getting address already bound 8080". Any idea how to do this - ideally by passing a property to "gradle run"? 回答1: You can use server: port: 9001 in application.yml . Or you can pass it via system environment. (e.g. SERVER_PORT=9001 grails run-app ). 回答2: grails run-app --port=8081 Or in interactive mode: run-app --port=8081 Don't forget to use the same port when you want to stop the server: stop-app --port=8081 I

How to connect Grails 3.0 to my local Mysql database

你。 提交于 2019-11-30 06:18:20
I'm quite new with Grails and trying to connect my application to my local mysql database. Since I'm working with the latest version of Grails, I couldn't really find a lot of documentation to help me out. Is there any clear documentation which could guide me in the right direction? (I've tried the official documentation, but it seems to be out of date) Datasource configuration in Grails 3 now is done also via the grails-app/conf/application.yml file. In a default project it is located in the final section of the file (starting with dataSource: ). The docs as of 2015-08-01 still explain the

grails 3.0.0 I can not create an application

泄露秘密 提交于 2019-11-29 16:29:34
I just downloaded Grails 3.0.0 (hoping to see my problems with CAS magically disappearing ;) ) I installed it under windows and then: D:\GrailsProjects> grails -version | Grails Version: 3.0.0 | Groovy Version: 2.4.3 | JVM Version: 1.7.0_51 and then: D:\IntelliJProjects>grails create-app helloworld | Error Command not found create-app Did you mean: create-script or create-taglib or create-unit-test? also clean and compile don't work What am I missing? ok that was trivial (and rather stupid). In the "project directory" among other projects there was a directory called grails-app, probably

grails 3 war in JBoss EAP 6.2.0 does not work

限于喜欢 提交于 2019-11-29 08:44:30
When I try to run a very simple grails 3 (3.0.7) application as war (with embedded tomcat removed) in JBoss EAP 6.2.0.GA (AS 7.3.0.Final-redhat-14) all requests end up in a HTTP 404. The same war works in Tomcat. Searching the web I found the following related to Spring Boot: springBoot application on Jboss EAP, servlet context not lodaed Unfortunately configuring the property server.servlet-path in application.yml (in yml format) did not work. Looking into the grails 3 source: https://github.com/grails/grails-core/blob/master/grails-plugin-controllers/src/main/groovy/org/grails/plugins/web

How to connect Grails 3.0 to my local Mysql database

瘦欲@ 提交于 2019-11-29 06:00:20
问题 I'm quite new with Grails and trying to connect my application to my local mysql database. Since I'm working with the latest version of Grails, I couldn't really find a lot of documentation to help me out. Is there any clear documentation which could guide me in the right direction? (I've tried the official documentation, but it seems to be out of date) 回答1: Datasource configuration in Grails 3 now is done also via the grails-app/conf/application.yml file. In a default project it is located

Grails 3 - change default port for run-app

安稳与你 提交于 2019-11-29 02:53:39
In Grails3 grails -Dserver.port=9001 run-app doesn't appear to work: I'm "getting address already bound 8080". Any idea how to do this - ideally by passing a property to "gradle run"? You can use server: port: 9001 in application.yml . Or you can pass it via system environment. (e.g. SERVER_PORT=9001 grails run-app ). grails run-app --port=8081 Or in interactive mode: run-app --port=8081 Don't forget to use the same port when you want to stop the server: stop-app --port=8081 I believe this feature was broken in 3.0.3 and earlier versions but it definitely works in 3.0.4. Accepted answer is

Grails 3 CSRF protection

醉酒当歌 提交于 2019-11-29 02:41:58
Is it possible to configure CSRF protection in grails3 app using spring-security plugin, I can't find anything except useToken attribute for grails form and then call withForm inside controller. But this is actually not a very flexible solution. I like approach with filter like here For csrf protection I reused org.springframework.security.web.csrf.CsrfFilter . You need to define new bean in grails resouces.groovy (See snipet below - csrfFilter bean). You can define your own accessDeniedHandler and requireCsrfProtectionMatcher . Here is the snippet from resources.groovy: csrfFilter(CsrfFilter,

grails 3.0.0 I can not create an application

走远了吗. 提交于 2019-11-28 10:07:01
问题 I just downloaded Grails 3.0.0 (hoping to see my problems with CAS magically disappearing ;) ) I installed it under windows and then: D:\GrailsProjects> grails -version | Grails Version: 3.0.0 | Groovy Version: 2.4.3 | JVM Version: 1.7.0_51 and then: D:\IntelliJProjects>grails create-app helloworld | Error Command not found create-app Did you mean: create-script or create-taglib or create-unit-test? also clean and compile don't work What am I missing? 回答1: ok that was trivial (and rather