grails-2.0

Google Visualization API. Graphs are not displaying in gsp pages

 ̄綄美尐妖づ 提交于 2019-12-07 18:56:56
问题 I am developing application with grails. Below is the list of Program I use. - Groovy/Grails Tool Suite Version: 3.5.1.RELEASE Platform: Eclipse Kepler SR2 (4.3.2) - Grails 2.3.8 - Java : jdk1.6.0_45 my problem is having installed google visualization plugin by specifying in the BuildConfig.groovy with the code below plugins { compile ":google-visualization:0.7" } and tried the sample below but the chart are not displaying. there seems to be no error what so ever. What I suspect is that the

Error initializing GroovyPageView

我的未来我决定 提交于 2019-12-07 18:46:29
I am using grails 2.3.4 . When I load my index.gsp page I get: | Server running. Browse to http://localhost:8080/testApplication | Application loaded in interactive mode. Type 'stop-app' to shutdown. | Enter a script name to run. Use TAB for completion: ....[/testApplication].[gsp] Servlet.service() for servlet [gsp] in context w ith path [/testApplication] threw exception org.codehaus.groovy.grails.web.mapping.exceptions.UrlMappingException: Error map ping onto view [/index]: Error initializing GroovyPageView at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1145)

Grails 2.4.4 Testing for permission where spring security code is being used

*爱你&永不变心* 提交于 2019-12-07 12:12:27
问题 I am using spock for may application testing and using Grails 2.4.4. I have done domain, controller, and service unit testing. But in controller sections I am stuck with the role wise access. For authentication I am using Spring Security Core Plugin. Below is my sample code. @Secured(["IS_AUTHENTICATED_FULLY"]) def index(Integer max) { } @Secured(["ROLE_A","ROLE_B"]) def create() { respond new DomainName(params) } @Transactional @Secured(["ROLE_A","ROLE_B"]) def save(DomainName

grails validate nested command object not working

我的梦境 提交于 2019-12-07 03:39:56
问题 I'm using grails 2.2.1 and attempting to validate a nested command structure. Here is a simplified version of my command objects: @Validateable class SurveyCommand { SectionCommand useful SectionCommand recommend SurveyCommand() { useful = new SectionCommand( question: 'Did you find this useful?', isRequired: true) recommend = new SectionCommand( question: 'Would you recommend to someone else?', isRequired: false) } } @Validateable class SectionCommand { String question String answer boolean

How can I pass javascript variable to grails controller using remoteFunction

淺唱寂寞╮ 提交于 2019-12-06 15:06:01
I am working with grails 2.1.1. I have a remote function from where I want to pass more than one java script variable through g:remoteFunction. But no js variable is going to controller. My js variables are underlined and are not recognized. Can anyone please help me on this please ?!!! Here are my attempts below :: My function >>> function addNewBill(){ var orgId = $('#aaOrgIdAaOrg').val(); var ccId = $('#costCenter').val(); if(orgId != null && orgId != "null" && orgId != "" && ccId != null && ccId != "null" && ccId != ""){ $('#ccModal').modal('hide'); ${remoteFunction(action: 'createBill',

belongsTo multiple Domain

醉酒当歌 提交于 2019-12-06 13:40:32
问题 I have 4 classes, incidents,problems, requests and another is Attachment. Every domain look like......... Class Incidents { // other fields static hasOne = [attachment: Attachment] static constraints = [attachment nullable:true] } Class Problems { // other fields static hasOne = [attachment: Attachment] static constraints = [attachment nullable:true] } Class Requests { // other fields static hasOne = [attachment: Attachment] static constraints = [attachment nullable:true] } Class Attachment {

Do Grails tests run in test environment by default?

别说谁变了你拦得住时间么 提交于 2019-12-06 10:28:09
问题 Is it necessary to supply the environment as grails test test-app ? 回答1: Grails tests do run in the test environment by default. In general Grails commands default to dev if not specified, but the test-app command overrides the environment to test if none was specified, and the war command defaults to prod if not specified. 来源: https://stackoverflow.com/questions/25287173/do-grails-tests-run-in-test-environment-by-default

Grails: Raw SQL query in the current transaction

坚强是说给别人听的谎言 提交于 2019-12-06 09:03:54
问题 I am trying to execute a raw sql query using something similar to def dataSource; Sql sql = new Sql(dataSource); But, it seems that this runs in a separate transaction of its own. It therefore misses all the (uncommitted) changes done before it in the service method. What is the best way to run a raw sql query in the current transaction? 回答1: The above code would create a new connection, hence a new transaction. You can use the current Hibernate session(injecting sessionFactory) to execute a

Google Visualization API. Graphs are not displaying in gsp pages

只愿长相守 提交于 2019-12-06 08:42:45
I am developing application with grails. Below is the list of Program I use. - Groovy/Grails Tool Suite Version: 3.5.1.RELEASE Platform: Eclipse Kepler SR2 (4.3.2) - Grails 2.3.8 - Java : jdk1.6.0_45 my problem is having installed google visualization plugin by specifying in the BuildConfig.groovy with the code below plugins { compile ":google-visualization:0.7" } and tried the sample below but the chart are not displaying. there seems to be no error what so ever. What I suspect is that the application does not recognise the tag . anybody has come across this problem, your help would be very

How to set formula in grails domain class?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 07:06:53
I am trying to write formula in my domain class which helps me in creating criteria. class MyClass { //some fields Date appointmentTime String ddmmyy int year int month int day static transients = [ 'ddmmyy', 'year', 'month', 'day' ] static mapping= { ddmmyy formula('DATE_FORMAT(appointmentTime)') year formula('YEAR(appointmentTime)') month formula('MONTH(appointmentTime)') day formula('DAYOFMONTH(appointmentTime)') } } Whenever I am trying to use this fields in my criteria it throws error i.e. can not resolve property 'ddmmyy' of 'myClass'. MyCriteria is: Date myDate = Calender.instance.time