grails-2.0

Read jars from lib folder in grails

ぃ、小莉子 提交于 2019-12-10 10:58:27
问题 I want to parse an excel file using the Apache POI library to boot strap some data in development mode into my grails 2.0.1 application. I've tried to use the Grails excel-import plugin but the plugin uninstalls automatically when I execute run-app. Because of that I decided to got ahead without the plugin for now. First I have copied the next jars into the grails application lib folder $ls -la lib poi-3.7-20101029.jar poi-ooxml-3.7-20101029.jar poi-ooxml-schemas-3.7-20101029.jar xmlbeans-2.3

How to check groovy script for compilation errors [duplicate]

╄→гoц情女王★ 提交于 2019-12-09 21:26:30
问题 This question already has an answer here : Compiling user entered groovy script at run time (1 answer) Closed 4 years ago . We can create and run groovyscript at runtime using code below import groovy.lang.GroovyClassLoader; import groovy.lang.GroovyObject; import java.io.File; import java.io.IOException; // Create a String with Groovy code. final StringBuilder groovyScript = new StringBuilder(); groovyScript.append("class Sample {"); groovyScript.append(" String sayIt() { return \"Groovy

Asserting on a list of items in Spock

做~自己de王妃 提交于 2019-12-09 03:15:34
问题 Using Spock 0.7 with Grails 2.04. Trying to set up a testing environment. I need some help in regards to testing a list of objects. I have a list of location objects. I want to test a date on each of those objects. I am iterating over but not sure how to make the test fail if the dates are not equal. Is there a good way to test objects in a list? I have listed below my then block of code. then: weatherList != null weatherList.empty != null weatherList.size() == 3 weatherList.each { Calendar

How to dynamically select a service in Grails

*爱你&永不变心* 提交于 2019-12-08 17:00:26
问题 From my controller I would like to dynamically select a service based on a parameter. Currently I have a base service and some other services that extent this base service. Based on the parameter I call a class that does creates a bean name based on the param and eventually calls the following: import org.codehaus.groovy.grails.web.context.ServletContextHolder as SCH import org.codehaus.groovy.grails.web.servlet.GrailsApplicationAttributes as GA class Resolver { def ctx def getBean(String

Grails 2, run-war -> java.lang.ClassNotFoundException: grails.test.mixin.services.ServiceUnitTestMixin

你说的曾经没有我的故事 提交于 2019-12-08 09:16:26
问题 Got a Grails 2 app and executing run-app works fine, run-war fails: 2011-12-24 12:43:40,996 [Thread-2] ERROR context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Lgrails/test/mixin/services/ServiceUnitTestMixin; at java.util.concurrent

Grails+Jquery-ui - integration issue?

醉酒当歌 提交于 2019-12-08 08:03:30
I have been trying to use grails with the jquery-ui plug-in, I have created a simple controller along with a gsp page that uses a datepicker, I have not been able to get the date picker to show a list of dates. I have read the plug in documentation + articles on forums etc. but have not found a resolution. Plug in documentation - http://grails.org/plugin/jquery-ui Dev environment = grails 2.2.0, JDK 7, GGTS latest version Any pointers to getting this working would be great. (I have tried copying/renaming files in web app/other folders but have not been successful) Steps 1. Created a new grails

Error initializing GroovyPageView

人盡茶涼 提交于 2019-12-08 07:42:33
问题 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

grails spring security login is not working

大城市里の小女人 提交于 2019-12-08 06:15:31
问题 I am using grails 2.1.0. I have installed spring-security-core plugin. When I create user it is creating it. But when I try to login then it shows: "Sorry, we were not able to find a user with that username and password." And there is also another fact that is when I use the same password for different user it does not save password with similar encoded value like for user 1 I have used password 123 which is saved in database like this

Grails+Jquery-ui - integration issue?

女生的网名这么多〃 提交于 2019-12-08 05:34:20
问题 I have been trying to use grails with the jquery-ui plug-in, I have created a simple controller along with a gsp page that uses a datepicker, I have not been able to get the date picker to show a list of dates. I have read the plug in documentation + articles on forums etc. but have not found a resolution. Plug in documentation - http://grails.org/plugin/jquery-ui Dev environment = grails 2.2.0, JDK 7, GGTS latest version Any pointers to getting this working would be great. (I have tried

How can I pass javascript variable to grails controller using remoteFunction

[亡魂溺海] 提交于 2019-12-08 02:11:51
问题 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