On Saturday 30 April 2016 22:04:57 Vlad Bailescu wrote:
> On Saturday, 30 April 2016, Oliver Lietz <[email protected]> wrote:
> > (service ranking is not honored by Sling's script engine manager, no need
> > to try).
> 
> Any idea why this is not a bug?

Why do you think it should be a bug?

Sling's Scripting support is built around Java's Scripting API (JSR-223) and 
that was obviously not designed to handle multiple script engines for one 
extension or mime type. So it is a limitation in Java's Scripting API.

>   https://issues.apache.org/jira/browse/SLING-4330
> 
> 
> I was under the impression SLING-4330 is about using both Sightly and
> Thymeleaf in the same running instance; and how to solve which one gets
> used on a file/script level.

Right.

> But for using just one scripting engine (Thymeleaf in this case) for a
> given extension we could just use the service ranking.

What is the benefit?

If you give Thymeleaf's script engine a higher service ranking than Sightly's 
to render HTML templates (.html) you make Sightly quite useless. The result is 
similar to deactivating/deinstalling Sightly's bundles (correct me if I'm 
wrong).

The other way round is not that destructive because Thymeleaf's script engine 
can be configured for different extensions (e.g. .htm, .thtml), can handle not 
only HTML but also XML, CSS, JavaScript, text and raw templates and makes its 
TemplateEngine available as OSGi service to render templates outside of 
Sling's Scripting context (see Fling sample).

So unless SLING-4330 is implemented and you want to use Thymeleaf for .html 
just deinstall Sightly.

Regards,
O.

> Best,
> Vlad

Reply via email to