Access Grails domain class from GroovyShell script

Posted by Martin Dow on Stack Overflow See other posts from Stack Overflow or by Martin Dow
Published on 2011-01-17T12:49:52Z Indexed on 2011/01/17 12:53 UTC
Read the original article Hit count: 247

Filed under:
|

I'm trying to use GroovyShell to evaluate some snippets of code from within a Grails application, but I don't seem to be able to access our Grails domain classes. For example when I try to evaluate something like this:

Eval.me("my.package.MyDomainClass.get(1)")

I see an error like this:

groovy.lang.MissingPropertyException: No such property: my for class: Script1

Any thoughts on how I can get this to work?

Thanks.

© Stack Overflow or respective owner

Related posts about grails

Related posts about groovy