groovy

How to 'hide' metaClass property in a Groovy class

I am creating some simple groovy classes, e.g. class Person { int age String name } that are being used in a Java method that relies on reflection to pull out the object properties, e.g. age and name. The problem is that metaClass is also showing up as a property. Updating the Java method to ignore this property is not an o...

Grails Duplicate Error Messages

Hi, I'm new to grails and I have a problem: I have this snippet of GSP: <g:form url="[controller:'main',action:'login']"> <label for="name">Usuario:</label><br/> <input type="text" name="name" /><br/> <label for="pass">Password:</label><br/> <input type="password" name="password"/><br/> <input type="submit" value="Logi...

Java User Interface Framework?

I am about to build a UI in Java and I am trying to determine what I should use. I definitely don't want to use vanilla swing. The one caveat is that it has to be added inside of an existing swing application. I am looking at JavaFX and Groovy Swing Builder. For the former it looks like there is fairly poor support for embedding into sw...

why aren't more people using Grails?

Hi, I've been learning Groovy & Grails recently, and in terms of developer productivity it seems to be light years ahead of other Java solutions (Spring, Struts, EJB, JSF). If I search monster.ca, for either Groovy or Grails, 0 matches are returned, which suggest Grails isn't doing too well in terms of adoption. I realise that: Grail...

Groovy session. How to find the user name

Hi I am developing an application under Groovy using scafoldig. We are using the Acegi plugin for security. We have a class called ChangeManagement defined as follows (simplified version) class ChangeManagement { static constraints = { company(nullable:false) lastModifiedByUser(nullable:false) } Company company ...

groovy static class

What does the 'static' do in this file, sample.groovy? static class froob { } The groovy code compiles fine with 'static' or without it. ...

IntelliJ Groovy version

Hi, I'm in the process of upgrading a project to Groovy v1.6. When I installed IntelliJ my GROOVY_HOME env. var. was pointing to Groovy v1.5.7, but now that I've changed GROOVY_HOME to point to v1.6, it's not clear whether IntelliJ is also using the more recent version. How can I check which version of Groovy IntelliJ is using? Thanks...

Running a groovy application under Maven

Hi! We have developed a Groovy application. Under development for starting it we use the following command line C:\myapp>mvn grails:run-app Without sending any request to the server one can see how the memory used by the java process in increasing and increasing. When it starts at about 100M are allocated and a couple of hours later...

ANSI color support using Groovy on Windows XP

Trying out the examples found on pleac.sf.net, I'm not able to get an example of ANSI colors to work on my WinXP box (Works fine on MacOS). What I've found is that on my WinXP machine, in both cygwin & DOS prompts, groovysh --color (and 'groovysh --terminal=unix') shows escape codes rather than the expected colored prompt. grep --color w...

how to inspect objects while debugging groovy (eclipse plugin or other)

hi, I have started to learn groovy by building a pet project. I fetch some html with XmlSlurper and parse it etc. I am using eclipse3.4 with groovy 1.6 plugin. I am having a very difficult time trying to iterate thorugh all the html elements etc. I expected to set some breakpoint, inspect the current variable where my contents are, see...

groovy closure parameters

Hi, The following example of using the sendMail method provided by the grails mail plugin appears in this book. sendMail { to "[email protected]" subject "Registration Complete" body view:"/foo/bar", model:[user:new User()] } I understand that the code within {} is a closure that is passed to sendMail as a parameter. I also...

Security Reinforcement: How to collect visitors' IP addresses in Grails Framework?

How to make a logging list of Users' IP addresses, should this be done via tomcat or grails or a combination of both ...

Best IDE for Grails 1.1.X development

Hi, I've been on a frustrating quest to find an IDE which provides reasonable support for Grails 1.1 development. My minimum requirements are: Supports running tests within the IDE Supports debugging within the IDE while running either the tests or the app itself Provides code-completion, including dynamic finders added to domain clas...

Groovy gotchas when integrating Groovy code in pre-exsting Java project.

We have a large scale Java web application project. I am considering integrating some Groovy code in situations where I think Groovy could reduce our effort. For example, XML parsing and unit testing. Are there any "gotchas" or negative impacts for this scenario. For instance, perhaps it would make our build much more complicated. I hav...

Grails GORM MissingMethodException with 1:N relationship

Hi guys, I have such domain classes: class ServicesGroup { Long id String name String description String toString(){ return name } static mapping = { version false table 'root.services_groups' id column:'group_id' name column:'group_name' description column:'gr...

Load application class from plugin

Hi, In a Grails 1.1 plugin, I'm trying to load a class from the main application using the following code: class MyClass { static Map getCustomConfig(String configName){ return new ConfigSlurper(). parse(ApplicationHolder.application.classLoader.loadClass(configName)) } } Where configName is the name of the c...

What is "coding by convention"?

I've been looking at Groovy on Grails and noticed a line at the bottom that says: Grails aims to bring the "coding by convention" paradigm to Groovy. What exactly is coding by convention? ...

A good-enough Linux IDE for Groovy/Grails code completion?

Is there a good development IDE for Groovy/Grails code completion under Linux? ...

favourite IDE for griffon development

I am experimenting with Groovy Griffon development and I am wondering what IDE to use. I am trying to use NetBeans 6.5, and I found this post http://blogs.sun.com/geertjan/entry/notes_on_converting_netbeans_grails essentially it describes forking the NetBeans trunk and hacking the Grails support; I was hoping for something more ligh...

Getting source code information from groovy stack trace

When exception generated I want to show some additional information (source code) for particular exception. But grails have very hairy exceptions (it's all about groovy dynamic nature). It's my problem where to get and how to display source code. All I need is file/line information. So... Is there any possibility to get file and line wh...