grails

Grails 3 call taglib from a service

徘徊边缘 提交于 2021-02-08 10:08:00
问题 I'm trying to use grails internal taglib from a service but I receive this error: No signature of method: MyService.message() is applicable for argument types: (java.util.LinkedHashMap) values: [[code:default.app.name]] This is the code I'm using: class MyService { def myMethod() { def appName = message(code: 'default.app.name') } } 回答1: Grails 3 The solution is to inject the grailsApplication object and use its context to get the taglib bean: class MyService { def grailsApplication def

Does a B Tree work well for auto suggest/auto complete web forms?

大兔子大兔子 提交于 2021-02-08 07:44:28
问题 Auto suggest/complete fields are used all over the web. Google has appeared to master it given that as soon as one types in a search query, suggestions are returned almost instantaneously. I'm assuming the framework for achieving this involves a fast, in-memory data store on the web tier. We're building a Grails app based around retail products, so a user may search for Can which should suggest things like Canon , Cancun , etc, and wondering if a Java B-tree cached in memory would suffice for

How to get the Url where Grails 3.1.9 integration tests are running?

半腔热情 提交于 2021-02-08 05:10:38
问题 From Grails 3.1.9 relase notes: Integration Test Port Integration and functional tests now run on a random port instead of the same port as the application by default. This is to avoid port conflict problems when the application is already running. Integration tests that hard code the port will need to be altered to use the serverPort property of tests marked with @Integration I was normally getting the integration test url with import grails.util.Holders ... .. . def

How to get the Url where Grails 3.1.9 integration tests are running?

独自空忆成欢 提交于 2021-02-08 05:10:32
问题 From Grails 3.1.9 relase notes: Integration Test Port Integration and functional tests now run on a random port instead of the same port as the application by default. This is to avoid port conflict problems when the application is already running. Integration tests that hard code the port will need to be altered to use the serverPort property of tests marked with @Integration I was normally getting the integration test url with import grails.util.Holders ... .. . def

How to get the Url where Grails 3.1.9 integration tests are running?

Deadly 提交于 2021-02-08 05:09:29
问题 From Grails 3.1.9 relase notes: Integration Test Port Integration and functional tests now run on a random port instead of the same port as the application by default. This is to avoid port conflict problems when the application is already running. Integration tests that hard code the port will need to be altered to use the serverPort property of tests marked with @Integration I was normally getting the integration test url with import grails.util.Holders ... .. . def

Spring webflow serialization trouble in production

隐身守侯 提交于 2021-02-08 04:34:07
问题 I have a grails app doing some stuff in the right way with webflow. So everything goes right in development mode, i can finish the registration and objects are serialized normally. But then, in production mode, deployed on a tomcat 7 with ssl, the following error appears when it's time to persist datas. In a nutshell the serialization don't work. Please help, i have no idea at the moment. The only difference of configuration is that i force https with spring security in production. ----------

Spring webflow serialization trouble in production

♀尐吖头ヾ 提交于 2021-02-08 04:32:20
问题 I have a grails app doing some stuff in the right way with webflow. So everything goes right in development mode, i can finish the registration and objects are serialized normally. But then, in production mode, deployed on a tomcat 7 with ssl, the following error appears when it's time to persist datas. In a nutshell the serialization don't work. Please help, i have no idea at the moment. The only difference of configuration is that i force https with spring security in production. ----------

How to fix “Invalid remember-me token (Series/token) mismatch” Error?

断了今生、忘了曾经 提交于 2021-02-07 09:18:13
问题 I use Spring Security persistent logins. I persist the remember me token in my database. Sometimes I get the following error: | Error 2013-07-02 13:54:14,859 [http-nio-8080-exec-2] ERROR [/buddyis].[gsp] - Servlet.service() for servlet [gsp] in context with path [/buddyis] threw exception Message: Invalid remember-me token (Series/token) mismatch. Implies previous cookie theft attack. Line | Method ->> 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor - - - - - - - - - - - - - - - -

How to fix “Invalid remember-me token (Series/token) mismatch” Error?

房东的猫 提交于 2021-02-07 09:13:59
问题 I use Spring Security persistent logins. I persist the remember me token in my database. Sometimes I get the following error: | Error 2013-07-02 13:54:14,859 [http-nio-8080-exec-2] ERROR [/buddyis].[gsp] - Servlet.service() for servlet [gsp] in context with path [/buddyis] threw exception Message: Invalid remember-me token (Series/token) mismatch. Implies previous cookie theft attack. Line | Method ->> 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor - - - - - - - - - - - - - - - -

How do I prevent exceptions from causing a transaction rollback under Grails?

佐手、 提交于 2021-02-06 08:51:14
问题 My Grails service is having an issue where a swallowed exception unrelated to a transaction is causing the transaction to rollback even when it is unrelated to the persistance of the domain object. In my service I have something along the lines of updateSomething(domainObj) { def oldFilename = domainObj.filename def newFilename = getNewFilename() domainObj.filename = newFilename domainObj.save(flush: true) try { cleanUpOldFile(oldFilename) } catch (cleanupException) { // oh well, log and