Hi,

Am Montag, den 22.10.2007, 12:19 +0200 schrieb Lars Trieloff:
> Hi Felix,
> 
> what about making the sling helper the only entry point for scripts?  
> This would have the benefit of allowing re-use of scripts that are  
> already using request, response, out, and resource variables.  

Well the current implementations of the Rhino and Velocity ScriptEngines
just set the respective variables as global variables. Scripts are free
to redefine these variables at will.

I mean for those use cases (probably most ?) having the most important
stuff readily available is quite usefull: Many people will be ready to
use request, response and (JSP people prominently) out.

> Additionally, you could sub-class the sling-helper easily, so that a  
> script engine can come with its own sling-helper that provides  
> additional convenience methods and can wrap the request, response and  
> resource in host objects, as I intend to do for Rhino.

ScriptEngine are implementations are free to do that: They get a Map of
entries intended to be set as global variables for the script. They can
of course do whatever they like with and to this map.

Regards
Felix

Reply via email to