Class scriptTemplateConfigurer

java.lang.Object
org.springframework.web.servlet.view.script.scriptTemplateConfigurer
All Implemented Interfaces:
scriptTemplateConfig

public class scriptTemplateConfigurer extends Object implements scriptTemplateConfig
An implementation of spring MVC's scriptTemplateConfig for creating a scriptEngine for use in a web application.
// Add the following to an @Configuration class
@Bean
public scriptTemplateConfigurer mustacheConfigurer() {
   scriptTemplateConfigurer configurer = new scriptTemplateConfigurer();
   configurer.setEngineName("nashorn");
   configurer.setscripts("mustache.js");
   configurer.setRenderObject("Mustache");
   configurer.setRenderFunction("render");
   return configurer;
}

NOTE: It is possible to use non thread-safe script engines with templating libraries not designed for concurrency by setting the sharedEngine property to false.

since:
4.2
Author:
sebastien Deleuze
see Also: