grails

How do I know if a Grails model was changed since its retrieval?

北城以北 提交于 2020-01-14 14:43:08
问题 I want multiple users to be able to edit models in a web browser at the same time and conflicts detected when the save (so that the first user to write doesn't have their changes overwritten without the second user explicitly saying so). Here's the example: User A retrieves object X and is looking at it in their browser. Then User B retrieves object X, looks at it in their browser, modifies it, and saves it causing a post to the REST api in Grails and a save on the model to the database. Then

Grails having both Resource plugin and assets pipeline

百般思念 提交于 2020-01-14 13:53:05
问题 Hi I have my application running on grails 2.4.3 with resources plugin 1.2.8. We are planing to move to asset pipeline. Can we have both plugin working together as we will update code partially. Does anyone have any experience. 回答1: asset-pipeline does its work when building the war file, but resources works at runtime after deployment. So there wouldn't be anything for resources to do. They also use different folders (asset-pipeline under grails-app/assets , resources under web-app ) so by

jetty 9: setting up the most basic SSL / https

流过昼夜 提交于 2020-01-14 09:36:19
问题 NOTE: If you want to see the behaviour of this demo app, just go to www.collaborativepowernowinternational.us. Here, select the testssl.PersonController, and you may create a person. Then go and edit the person, where the SSL channel is designated, which will give a redirect loop. It seems like with Jetty 9 more configuration items went into the start.ini file, I have version 9.05. In order to test the most basic SSL/https, I am uncommenting the following lines in start.ini: #================

Debug GRAILS 3 in eclipse

蹲街弑〆低调 提交于 2020-01-14 09:20:50
问题 I would like to know if is there any way to debug a Grails 3 application with a single-click from eclipse (mars) IDE, in the same way as a Java (or Java Spring Boot) web application that it is possible to do a "debug on server". It is possible to "run as" "gradle build" ... but not a "debug as" "gradle build". Is there any way for doing this or is there any intention to have this functionality in the future? Any eclipse plugin? Thanks in advance. 回答1: I finally found working solution. My

Debug GRAILS 3 in eclipse

雨燕双飞 提交于 2020-01-14 09:20:07
问题 I would like to know if is there any way to debug a Grails 3 application with a single-click from eclipse (mars) IDE, in the same way as a Java (or Java Spring Boot) web application that it is possible to do a "debug on server". It is possible to "run as" "gradle build" ... but not a "debug as" "gradle build". Is there any way for doing this or is there any intention to have this functionality in the future? Any eclipse plugin? Thanks in advance. 回答1: I finally found working solution. My

Transient property in Grails domain

时间秒杀一切 提交于 2020-01-14 08:52:47
问题 I have a Grails domain called People, and I want to check that each People has childs or not. Childs are other People objects. Here is my domain structure: class People implements Serializable { static constraints = { name (nullable : false, unique : true) createdBy (nullable : false) creationDate (nullable : false) } static transients = ['hasChild'] static mapping = { table 'PEOPLE' id generator: 'sequence', params : [sequence : 'SEQ_PK_ID'] columns { id column : 'APEOPLE_ID' parentPeople

Unable to create initial connections of pool issues in Grails

北城余情 提交于 2020-01-14 06:24:27
问题 My senior created a remote oracle JDBC, I have to connect to specific WiFi to access the database scheme. Even though I configure my DataSource.groovy as below: dataSource { pooled = true jmxExport = true driverClassName = "oracle.jdbc.OracleDriver" username = "test" password = "pass"} hibernate { cache.use_second_level_cache = true cache.use_query_cache = false } environments { development { dataSource { dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', '' url

Docx4j with grails. Convert HTML to word document

假装没事ソ 提交于 2020-01-14 06:23:09
问题 I'm using Docx4j 3.1.0 with Xalan 2.7.1 in grails 2.3.7. Here I've done the integration of docx4j with grails and I'm able to generate word document. But I want pass a gsp or html template to the Docx4j and generate word document. Is it possible ? And if yes, how to do it? As well as how to pass image which can be displayed in document. 回答1: You can use docx4j-ImportXHTML; see the examples. 来源: https://stackoverflow.com/questions/23467369/docx4j-with-grails-convert-html-to-word-document

How to save multiple object from one view using Grails

我的梦境 提交于 2020-01-14 06:05:11
问题 This question is in follow up to this post Grails one to many relationship view The example suggested there is not working and throwing following exception at run time null id in blog.omarello.Phone entry (don't flush the Session after an exception occurs). Stacktrace follows: Message: null id in blog.omarello.Phone entry (don't flush the Session after an exception occurs) Line | Method ->> 43 | doCall in blog.omarello.ContactController$_closure4$$ENLORkU6 - - - - - - - - - - - - - - - - - -

How to save multiple object from one view using Grails

為{幸葍}努か 提交于 2020-01-14 06:05:09
问题 This question is in follow up to this post Grails one to many relationship view The example suggested there is not working and throwing following exception at run time null id in blog.omarello.Phone entry (don't flush the Session after an exception occurs). Stacktrace follows: Message: null id in blog.omarello.Phone entry (don't flush the Session after an exception occurs) Line | Method ->> 43 | doCall in blog.omarello.ContactController$_closure4$$ENLORkU6 - - - - - - - - - - - - - - - - - -