类 ScriptTemplateConfigurer

  • 所有已实现的接口:
    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, like Handlebars or React running on Nashorn, by setting the sharedEngine property to false.

    从以下版本开始:
    4.2
    作者:
    Sebastien Deleuze
    另请参阅:
    ScriptTemplateView