Hi all, I included this quite simple Groovy script in a XWiki page: <% println "Hello World" list = ["Rod", "James", "Chris"] list.each { println it } println "${list.size()}" %> And I get... Hello World 3 But nothing about printing list. The same script works fine in groovyConsole being the output: Hello World Rod James Chris 3 Please, what am I doing wrong? Must I expect that a script working in groovyConsole do the same in a XWiki page? Thanks for your help, Ricardo -- Ricardo Rodríguez Your EPEC Network ICT Team
Hi Ricardo, I remember this problem was reported some time ago but unfortunately nobody has looked into it: http://jira.xwiki.org/jira/browse/XWIKI-361 We'd like to move to the latest Groovy version in 1.3. Maybe this will help. Any help would be most welcome. Thanks -Vincent On Jan 27, 2008, at 12:07 AM, [Ricardo Rodriguez] Your EPEC Network ICT Team wrote:
Hi all,
I included this quite simple Groovy script in a XWiki page:
<% println "Hello World" list = ["Rod", "James", "Chris"] list.each { println it } println "${list.size()}" %>
And I get...
Hello World 3
But nothing about printing list.
The same script works fine in groovyConsole being the output:
Hello World Rod James Chris 3
Please, what am I doing wrong? Must I expect that a script working in groovyConsole do the same in a XWiki page?
Thanks for your help,
Ricardo
-- Ricardo Rodríguez Your EPEC Network ICT Team
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Vincent Massol wrote:
Hi Ricardo,
I remember this problem was reported some time ago but unfortunately nobody has looked into it: http://jira.xwiki.org/jira/browse/XWIKI-361
We'd like to move to the latest Groovy version in 1.3. Maybe this will help. Any help would be most welcome.
Oops! I was not able either to find it prior to send this message to the list. Sorry. I've tried to change groovy-all-1.0-jsr-06.jar with groovy-1.5.1.jar but it seems that it is not that simple to move to the new Groovy version :-( I'll make any new comment in the concerned JIRA Issue. Thanks, -- Ricardo Rodríguez Your EPEC Network ICT Team
[Ricardo Rodriguez] Your EPEC Network ICT Team wrote:
I've tried to change groovy-all-1.0-jsr-06.jar with groovy-1.5.1.jar but it seems that it is not that simple to move to the new Groovy version :-(
I'll make any new comment in the concerned JIRA Issue.
Thanks,
Call me stupid! The name of the folder in the Groovy distribution can not be clearest: embeddable. The .jar to be embedded is not groovy-1.5.1.jar but groovy-all-1.5.1.jar. I've copied this -jar to Xwiki lib, restarted the servlet container and voilá! each() works now. The only difference with groovyConsole is that the browser doesn't move to a new line after each output item, but this is just a minor issue that can be solved by simply including a <br> in each output line. Something like: <% list = ["Rod", "James", "Chris"] list.each { println it + "<br>"} %> I will add a comment in the concerned JIRA issue. Cheers, Ricardo -- Ricardo Rodríguez Your EPEC Network ICT Team
participants (2)
-
[Ricardo Rodriguez] Your EPEC Network ICT Team -
Vincent Massol