I have noticed the past couple of weeks that every once in awhile my Grails app will hang on a request. There is nothing in the logs, no exceptions/stack. Also, the page doesn't time out, it just attempts to load without end. I have been unable to determine how to definitely reproduce this problem and that's why I say it appears to be ra...
I am setting an external file to hold some persistent variables as Properties()
Is there an easy way to list these in the same way that
System.Properties()
does?? to produce a list of Properties I have set.
...
Is it possibly to dynamically set the class of an expando??
Having set
jr = new Expando()
Is there a way to
def end = 'name'
so that
jr.end
will actually give me the value stored in
jr.name
...
Howdy,
I'm using STS 2.3.3.CI-R5473-B24 with Grails 1.1. When launching the Type Grails command... yellow popup, is there a way to use grails-debug, rather than grails to run the commands?
...
Hello,
I'm comparing values of an excel sheet to record values returned from a database and one record is passing through the if statement when it should fail the if statement.
The if statement looks like this:
if (record.value.equals(cellVal) == false)
{
record.value = cellVal
record.modifyUser = userId
...
Hello,
I've written an excel upload function that allows a user to upload an excel sheet through a web interface and it will commit it to a table. The problem is that with a table with many records, it takes some time to go through each record and check for changes, so it tends to hang. What would be the best solution for a progress ba...
class Test {
String field
int num
public Test (String field, int num) {
this.field = field
this.num = num
}
}
def start = System.currentTimeMillis()
def testObj = new Test("i'm field", 1)
println "Beans: ${System.currentTimeMillis() - start}"
def start2 = System.currentTimeMillis()
def map = [:]
map....
Coming from a J2EE dev background, I love the idea of Grails....all the benefits of using enterprise Java (Spring, Hibernate, etc. ), but with the simplicity of Rails (scaffolding, convention over configuration, Groovy scripting, etc.). My company is considering rolling out a new enterprise scale web application built on top of Grails. I...
Hello,
I have a mock response, which needs to return a value that was in the request. For example, this request can come in:
<myReqest><myValue>123</myValue></myRequest>
I already have a mockResponse:
<myResponse><yourValue>${theValue}</yourValue></myResponse>
I know how to set the value of ${theValue} through the context variable...
I have a map in groovy that looks like the following...
def book = [Title of Book: "Groovy Recipes", Author: "Scott Davis", Number of Pages: "241"]
I add my each 'book' into a BookList and would like to be able to get each value later on but when I try something like...
BookList.Title of Book[0] //prints something like Title[0] inste...
For our grails application, I've written a method that lets you upload a CSV file full of contacts, and it will parse the file and create contacts out of the data. I've used a test file of my own (hard-coding which fields mean what) and it works great.
But of course I can't leave the field references hard-coded like that, so my next ste...
Hi,
Please can you help with the example below:
class Car {
static hasMany = [cd:Cd, fluffyDice:FluffyDice, wheel:Wheel]
}
class Wheel{
static belongsTo = [car:Car]
}
How do I enforce that a car has at least one wheel?
...
In groovy [].sum() returns null when I expect 0
...
When i try execute the following code, which should just print a slashy string in groovy console version 1.7.4 i get a compilation error:
println /slashy string/
if i change this to:
def s = /slashy string/;
println s
everything is fine and the expected string is printed.
Any ideas what i am doing wrong?
...
We've got an Excel spreadsheet floating around right now (globally) at my company to capture various pieces of information about each countries technology usage. The problem is that it goes out, gets changes, but they're never obvious, and often conflicting - and then we have to smash them together. To me, the workbook is no more than a ...
Okay, I've the strangest problem that I've just started to experience in a grails application working just fine for 2 months.
Application is deployed on Linux/Tomcat 6 and MySQL is the DBMS at back end.
When I type date on linux prompt, I get following output:
$>date
Sun Aug 8 03:52:06 PKT 2010
Where as in Grails application new Da...
I have recently come across the languages Groovy and Scala which are built on the JVM. But I dont know much beyond that. Are those languages going to overtake Java at some point? Do these languages serve for any special purpose? Which of them is faster and more powerful? For what type of applications should I choose Groovy/Scala? Will it...
I am parsing some XML with XMLSlurper (groovy 1.7.4) and I need to delete a tag (not make it empty!). Here is a code sample illustrating it:
import groovy.xml.StreamingMarkupBuilder
def CAR_RECORDS = '''
<records>
<car name='HSV Maloo' make='Holden' year='2006'>
<country>Australia</country>
<record type='speed...
My project's copy contains the following snippet in HibernateGrailsPlugin.groovy :
def doWithDynamicMethods = {
def dynamicMethods = HibernatePluginSupport.doWithDynamicMethods
dynamicMethods.delegate = delegate
dynamicMethods.call(it)
// aids in generating appropriate documentation in plugin.xml since
...
I'm working with an API that returns a groovy.util.Node, allowing me to customize its generated XML. I need to append a child element into the Node, and I'm wondering if I can use MarkupBuilder syntax to modify the Node.
For example, here's something that works, but seems klunky:
withXml { rootNode ->
def appendedNode = new Node...