It's not really relayed to Groovy, Velocity cannot work with statics.
You will have to work with non static methods and assign one script
binding to an instance of your groovy class like in:
{{groovy}}
class MyClass {
myFunction(out) {
out.println "hello world"
}
mytool = new MyClass()
{{/groovy}}
{{velocity}}
$mytool.myFunctionnction(out)
{{/velocity}}
On Sat, Mar 15, 2014 at 9:12 PM, Matthias Albert <matthias.albert(a)gmx.de> wrote:
Hi all,
after I managed to write a groovy class with a static method within a
groovy block:
{{groovy}}
class MyClass {
static myFunction(out) {
out.println "hello world"
}
MyClass.myFunction(out)
{{/groovy}}
I would like to invoke thos static groovy class function from within a
Velocity block:
${MyClass.myFunction(out)}
But unfortunately, this does not work. Nothing will be displayed.
Has anybody an idea for help?
Thanks Matthias
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
--
Thomas Mortagne