grails

how to use grails ${createLink} in javascript

二次信任 提交于 2020-01-25 05:26:55
问题 i have a javascript function as follows function GetSelectedItem() { var e = document.getElementById("country"); var strSel = e.options[e.selectedIndex].value; alert(strSel); var url = "${createLink(controller:'country', action: 'wholeTestUnits', id: strSel)}" alert(url); } i want to go to that url action when i click the submit button like <button class="submit_small" onClick="GetSelectedItem();"> <span><g:message code="default.button.submit.label" /></span> </button> This ${createLink} is

Grails Heap space overflowing intermittently

末鹿安然 提交于 2020-01-24 21:08:34
问题 I have one of those joyous problems that is intermittent and hard to replicate. After either minutes or days of operation my grails app on our Test server fails. I cannot replicate on Dev or my local. The stacktrace pattern example here clipped off the middle as its 1000's lines (this will just keep going dumping like this until I restart Tomcat): at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at grails.plugin.springcache.web.GrailsFragmentCachingFilter

How to initialise/wire beans in Grails Spock unit tests?

倖福魔咒の 提交于 2020-01-24 12:50:06
问题 I'm wanting to test a Grails controller that contains a bean (I'll move it to a Service when I get it working, but I just want to keep it simple now). //resources.groovy beans { myBean(com.me.MyBean) } // MyBean.java // this needs to be in java as it is playing with spring-data-neo4j package com.me; public class MyBean { String show() { return "Hello"; } } // TestController.groovy package com.me import com.me.MyBean class TestController { def myBean def index() { render myBean.show() } } //

Grails richui autocomplete for cloned textbox

此生再无相见时 提交于 2020-01-24 09:44:45
问题 I am using grails richui autocomplete field in my app. It works fine for my static textbox but when I clone the textbox this feature is not working for the cloned textboxes and it shows no error even. Any idea of how to fix this Here is my code: <resource:autoComplete skin="default" /> at top <richui:autoComplete name="filterLocation1" id="filterLocation1" delimChar=";" class="location_txtbox" action="${createLinkTo('dir': 'abc/yyy')}" style="margin-left:5px;"/> This is my autocomplete field

What is the difference between withTransaction and withNewTransaction?

亡梦爱人 提交于 2020-01-24 04:02:06
问题 What is the difference between the following actions? def someAction() { User.withTransaction { ... } } and def someAction() { User.withNewTransaction { ... } } When do I use what? When a grails action contains only a Transaction block. In this case I guess withTransaction and withNewTransaction are the same, because each action has its own transaction. Is this true? 回答1: I believe these functions have to do with transaction isolation semantics. The withTransaction function will participate

Grails - Error Forked Grails VM exited with error

喜你入骨 提交于 2020-01-24 02:53:09
问题 First of all I would like to say that I am a beginner with Grails and while trying to follow some examples I kept getting an error I was unable to solve, so sorry if the question is stupid. I created a dummy app through the command line, and tried to run it the same way (run-app) but I get the following error: Running Grails application Error occurred during initialization of VM Error opening zip file or JAR manifest missing : C:...\grails-2.3.1\lib\org.springsource.springloaded-core\jars

How to Configure Spring Security Rest for Grails 3.x

余生长醉 提交于 2020-01-24 00:50:08
问题 How do you configure Spring Security Rest Plugin for Grails 3.x (currently I'm using Grails 3.1.0 RC2). The plugin page says to "Add compile :spring-security-rest:${version} to your BuildConfig.groovy ," but BuildConfig.groovy has been removed from Grails 3.x edit: the docs on the plugin page have been updated 回答1: SO I got this working. First off, the documentation located [here][1] is much more up to date. You need to add the following to build.gradle build.gradle dependencies { //Other

How to set default behaviour to Grails' Criteria?

匆匆过客 提交于 2020-01-23 19:22:27
问题 What I'd like to do is to set: setReadOnly(true) to every criteria query by default. Is it possible to define default settings that would be applied to every single criteria query that is executed in the application? P.S. I would possibly want to add the following as criteria defaults also but am unsure, whether they would have any additional effect to setReadOnly: setCacheMode(CacheMode.IGNORE) setFlushMode(FlushMode.MANUAL) 回答1: Done some digging and found this for you: http://www

How to set default behaviour to Grails' Criteria?

耗尽温柔 提交于 2020-01-23 19:22:18
问题 What I'd like to do is to set: setReadOnly(true) to every criteria query by default. Is it possible to define default settings that would be applied to every single criteria query that is executed in the application? P.S. I would possibly want to add the following as criteria defaults also but am unsure, whether they would have any additional effect to setReadOnly: setCacheMode(CacheMode.IGNORE) setFlushMode(FlushMode.MANUAL) 回答1: Done some digging and found this for you: http://www

How do I save a composite field value in Grails GSP?

╄→гoц情女王★ 提交于 2020-01-23 17:39:05
问题 I have a composite domain object as follows: class Person { static embedded = ['forSale'] Boolean isSelling House forSale } class House { Integer numBedrooms } I have a select control for the numBedrooms as follows: <tr class="prop"> <td valign="top" class="name"> <label for="numBedrooms"><g:message code="person.numBedrooms.label" default="Num Bedrooms" /></label> </td> <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'forSale.numBedrooms', 'errors')}"> <g:select name=