On Friday 23 January 2015 14:03:08 Felix Meschberger wrote: > 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….
Ok, that is what I had in mind. Right now Thymeleaf's template resolver checks if the path of the resource resolved by Sling (as described by Radu) matches the configured patterns. If it's not the case a default servlet renders the (HTML) script. Regards, O. > Regards > Felix
