Java 类org.springframework.web.servlet.view.script.ScriptTemplateViewResolver 实例源码

项目:react-practice-web    文件:WebApplication.java   
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
    ScriptTemplateViewResolver viewResolver = new ScriptTemplateViewResolver();
    viewResolver.setPrefix("/templates/");
    viewResolver.setSuffix(".js");
    registry.viewResolver(viewResolver);
    registry.scriptTemplate();
    super.configureViewResolvers(registry);
}
项目:spring-react-isomorphic    文件:IsomorphicApplication.java   
@Bean
public ViewResolver reactViewResolver() {
    ScriptTemplateViewResolver viewResolver = new ScriptTemplateViewResolver();
    viewResolver.setPrefix("static/templates/");
    viewResolver.setSuffix(".ejs");
    return viewResolver;
}
项目:spring4-understanding    文件:ViewResolverRegistry.java   
private ScriptRegistration() {
    super(new ScriptTemplateViewResolver());
    getViewResolver();
}
项目:spring4-understanding    文件:ViewResolverRegistryTests.java   
@Test
public void scriptTemplate() {
    this.registry.scriptTemplate().prefix("/").suffix(".html").cache(true);
    ScriptTemplateViewResolver resolver = checkAndGetResolver(ScriptTemplateViewResolver.class);
    checkPropertyValues(resolver, "prefix", "/", "suffix", ".html", "cacheLimit", 1024);
}
项目:spring4-understanding    文件:ViewResolverRegistryTests.java   
@Test
public void scriptTemplateDefaultValues() {
    this.registry.scriptTemplate();
    ScriptTemplateViewResolver resolver = checkAndGetResolver(ScriptTemplateViewResolver.class);
    checkPropertyValues(resolver, "prefix", "", "suffix", "");
}