Hi > Am 23.01.2015 um 13:29 schrieb Radu Cotescu <[email protected]>: > > On Fri, Jan 23, 2015 at 1:59 PM, Oliver Lietz <[email protected]> wrote: > >>> Whatever the approach is, if we want to allow multiple scripting engines >> to >>> use the same extension we need to refactor the code from the >>> SlingScriptEngineManager. >> >> Why? The ScriptEngine itself can decide if it kicks in for a script based >> on >> the paths patterns. > > > > Because currently the script engines are just template processors. The > SlingServletResolver is the component that maps a request to the script > engine that will provide the output, with the help of the > SlingScriptAdapterFactory and the SlingScriptEngineManager.
Exactly: The SlingScriptAdapterFactory checks the extension of the script and selects the ScriptEngine for this extension. Only one ScriptEngineFactory of a particular extension can be registered at any one time. So this one is select and called to evaluate the script. If the ScriptEngine decides to not actually evaluate it, nothing more happens. We have to make sure we improve on the ScriptEngine selection mechanism. I don’t want to cycle through multiple ScriptEngine’s until one decides to handle…. Regards Felix
