Hi Duke,
From my understanding, Velocity gets processed before Groovy so any
Velocity syntax in Groovy code will get evaluated by Velocity which
might give some strange behavior. For instance the following code:
<%
value = 20
println "Value : ${value}"
%>
#set($value="10")
<%
value = 30
println "Value : ${value}"
%>
Gives the following output:
Value : 20
Value : 10
Because the first time ${value} evaluates to "${value}" and the second
time to "10". Then Groovy does a second pass.
Luis.
On 9/8/05, Duke Tantiprasut <duke(a)resolve-systems.com> wrote:
Hi All,
I'm starting to have a look at groovy scripting in xwiki and have a couple
of basic questions:
In the example below (from
xwiki.org)
<%
def foo(list, value)
{
println "Calling function foo() with param ${value} <br>";
list << value;
}
x = [];
foo(x, 1);
foo(x, 2);
foo(x, 3);
foo(x, 4);
println "Creating list ${x}";
%>
1) does the groovy variable ${value} get translated before the velocity
${value} (if defined) or vice versa?
2) I tried the example and get the following result:
Calling function foo() with param 1
Calling function foo() with param 2
Calling function foo() with param 3
Calling function foo() with param 4
Creating list 1, 2, 3, 4?
where the "1, 2, 3, 4?" is a link to "1,+2,+3,+4". I assume the
output from
groovy is then processed by the xwiki syntax?
Thanks
Duke
--
You receive this message as a subscriber of the xwiki-users(a)objectweb.org mailing list.
To unsubscribe: mailto:xwiki-users-unsubscribe@objectweb.org
For general help: mailto:sympa@objectweb.org?subject=help
ObjectWeb mailing lists service home page:
http://www.objectweb.org/wws