Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3669

Can't use several times the same JSR-223 ScriptContext for differents groovy script

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6
    • 1.6.5, 1.7-beta-2
    • JSR / TCK / GLS
    • 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.

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            tmortagne Thomas Mortagne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: