Language injection using a template language?


Is it possible to use language injection with a template language?

String s =
"hello" +
"<% if(true) { %>" +
"foo" +
"<% } %>" +

This example fails to fully engage language injection for the MTL template language (from the Manifold project), the inner scripting language (Java) appears to be ignored.  I tried a similar example with JSP and it throws a ClassCastException (which I reported to JetBrains).  Is there some API a template language can implement to make injection work properly?  Thanks.


Please sign in to leave a comment.