Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6
-
None
Description
My use case is that i want to use the same ScriptContext for several scripts which are supposed to shared the same script context but are different script and different output (see http://code.xwiki.org/xwiki/bin/view/Macros/ScriptMacro).
In more details the problem is that GroovyScriptEngineImpl trait the script as something supposed to be used only once and as soon as it set some variables for its internal need it does not take into account anymore provided writer for example. So I can't use the same ScriptContext for two different scripts.
Also I think when i finished executing the script i should not find a "out" binding in my ScriptContext since it's internal groovy use. "context" is a reserved JSR 223 binding but it's not i should not find it either in the ScriptContext after the execution IMO.
Right now i have to clean the ScriptContext to be able to properly reuse it with a new writer.