use of org.thymeleaf.spring5.SpringTemplateEngine in project irida by phac-nml.
the class IridaUIWebConfig method templateEngine.
@Bean
public SpringTemplateEngine templateEngine() {
SpringTemplateEngine templateEngine = new SpringTemplateEngine();
templateEngine.setTemplateResolver(templateResolver());
templateEngine.setEnableSpringELCompiler(false);
templateEngine.setAdditionalDialects(additionalDialects());
return templateEngine;
}
use of org.thymeleaf.spring5.SpringTemplateEngine in project irida by phac-nml.
the class MvcConfiguration method templateEngine.
/**
* Thymeleaf needs a template engine, get a {@link SpringTemplateEngine}
*
* @return {@link SpringTemplateEngine}
*/
@Bean
public SpringTemplateEngine templateEngine() {
SpringTemplateEngine engine = new SpringTemplateEngine();
engine.setTemplateResolver(templateResolver());
return engine;
}
use of org.thymeleaf.spring5.SpringTemplateEngine in project spring-boot-admin by codecentric.
the class MailNotifierTest method setup.
@BeforeEach
public void setup() {
repository = mock(InstanceRepository.class);
when(repository.find(instance.getId())).thenReturn(Mono.just(instance));
sender = mock(JavaMailSender.class);
when(sender.createMimeMessage()).thenAnswer((args) -> new MimeMessage(Session.getInstance(new Properties())));
SpringTemplateEngine templateEngine = new SpringTemplateEngine();
ClassLoaderTemplateResolver resolver = new ClassLoaderTemplateResolver();
resolver.setTemplateMode(TemplateMode.HTML);
resolver.setCharacterEncoding(StandardCharsets.UTF_8.name());
templateEngine.addTemplateResolver(resolver);
notifier = new MailNotifier(sender, repository, templateEngine);
notifier.setTo(new String[] { "foo@bar.com" });
notifier.setCc(new String[] { "bar@foo.com" });
notifier.setFrom("SBA <no-reply@example.com>");
notifier.setBaseUrl("http://localhost:8080");
notifier.setTemplate("/META-INF/spring-boot-admin-server/mail/status-changed.html");
}
Aggregations