@Override public void configureViewResolvers(ViewResolverRegistry registry) { ScriptTemplateViewResolver viewResolver = new ScriptTemplateViewResolver(); viewResolver.setPrefix("/templates/"); viewResolver.setSuffix(".js"); registry.viewResolver(viewResolver); registry.scriptTemplate(); super.configureViewResolvers(registry); }
@Bean public ViewResolver reactViewResolver() { ScriptTemplateViewResolver viewResolver = new ScriptTemplateViewResolver(); viewResolver.setPrefix("static/templates/"); viewResolver.setSuffix(".ejs"); return viewResolver; }
private ScriptRegistration() { super(new ScriptTemplateViewResolver()); getViewResolver(); }
@Test public void scriptTemplate() { this.registry.scriptTemplate().prefix("/").suffix(".html").cache(true); ScriptTemplateViewResolver resolver = checkAndGetResolver(ScriptTemplateViewResolver.class); checkPropertyValues(resolver, "prefix", "/", "suffix", ".html", "cacheLimit", 1024); }
@Test public void scriptTemplateDefaultValues() { this.registry.scriptTemplate(); ScriptTemplateViewResolver resolver = checkAndGetResolver(ScriptTemplateViewResolver.class); checkPropertyValues(resolver, "prefix", "", "suffix", ""); }