[ 
https://issues.apache.org/jira/browse/VELOCITY-799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15383808#comment-15383808
 ] 

Claude Brisson commented on VELOCITY-799:
-----------------------------------------

You are right, the spec says:

  In all cases, the ScriptContext used during a script execution must be a value
  in the Engine Scope of the ScriptEngine whose key is the String “context”

So it's not exactly an autoreference key, but it's close: the ScriptContext 
contains nested scoped Bindings, plus references to the reader, the writer and 
the errorReader, and it should be visible its own engine scope bindings.

But it should be enforced, and after a little check it appears our 
implementation was not correct because I took the liberty of renaming the key 
to 'script_context'. I fixed it.


> Optionally add context to itself
> --------------------------------
>
>                 Key: VELOCITY-799
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-799
>             Project: Velocity
>          Issue Type: Improvement
>            Reporter: Sebb
>            Assignee: Claude Brisson
>             Fix For: 2.x
>
>
> For debugging scripts, it would sometimes be useful to have access to the 
> context within a VM script.
> For example, one could then print out all the variables that are defined in 
> the context.
> The suggestion is to enable this via a properties file or a system property.
> If the property is defined, its value would be used as the name of the 
> variable holding the context.
> e.g. -Dvelocity.context.variable=ctx
> Obviously feel free to choose a better property name.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org

Reply via email to