You need to know that velocity executes before groovy in the rendering process so what you wrote below is not correct.

-Vincent

On Mar 1, 2008, at 2:15 PM, Ngo Thi Hong Nga wrote:

I want to set content of a document with #warning("My message")
When code by Velocity:
$newdoc.setContent('#warning("My message")')  --> the code works
but when code by Groovy
<%
...
newdoc.setContent("#warning(\"My message\")");
%>
--> Error number 4001 in 4: Error while parsing velocity page MySpace.MyDoc Wrapped Exception: Lexical error:

How to solve this error ?