Open robiasto opened 4 months ago
Actual example found here does not work for me.
@Bean public SpringTemplateEngine templateEngine(){ SpringTemplateEngine templateEngine = new SpringTemplateEngine(); templateEngine.setEnableSpringELCompiler(true); templateEngine.setTemplateResolver(templateResolver()); templateEngine.addDialect(new HelloDialect()); return templateEngine; }
Problems:
My Fix
@Bean public SpringTemplateEngine templateEngine(ClassLoaderTemplateResolver templateResolver, ObjectProvider<IDialect> dialects){ SpringTemplateEngine templateEngine = new SpringTemplateEngine(); templateEngine.setEnableSpringELCompiler(true); templateEngine.setTemplateResolver(templateResolver); dialects.orderedStream().forEach(templateEngine::addDialect); templateEngine.addDialect(new HelloDialect()); return templateEngine; }
Actual example found here does not work for me.
Problems:
My Fix