Search in sources :

Example 46 with ClassLoaderTemplateResolver

use of org.thymeleaf.templateresolver.ClassLoaderTemplateResolver in project tutorials by eugenp.

the class ThymeleafConfiguration method emailTemplateResolver.

@Bean
@Description("Thymeleaf template resolver serving HTML 5 emails")
public ClassLoaderTemplateResolver emailTemplateResolver() {
    ClassLoaderTemplateResolver emailTemplateResolver = new ClassLoaderTemplateResolver();
    emailTemplateResolver.setPrefix("mails/");
    emailTemplateResolver.setSuffix(".html");
    emailTemplateResolver.setTemplateMode("HTML5");
    emailTemplateResolver.setCharacterEncoding(CharEncoding.UTF_8);
    emailTemplateResolver.setOrder(1);
    return emailTemplateResolver;
}
Also used : ClassLoaderTemplateResolver(org.thymeleaf.templateresolver.ClassLoaderTemplateResolver)

Example 47 with ClassLoaderTemplateResolver

use of org.thymeleaf.templateresolver.ClassLoaderTemplateResolver in project tutorials by eugenp.

the class ThymeleafConfiguration method emailTemplateResolver.

@Bean
@Description("Thymeleaf template resolver serving HTML 5 emails")
public ClassLoaderTemplateResolver emailTemplateResolver() {
    ClassLoaderTemplateResolver emailTemplateResolver = new ClassLoaderTemplateResolver();
    emailTemplateResolver.setPrefix("mails/");
    emailTemplateResolver.setSuffix(".html");
    emailTemplateResolver.setTemplateMode("HTML5");
    emailTemplateResolver.setCharacterEncoding(CharEncoding.UTF_8);
    emailTemplateResolver.setOrder(1);
    return emailTemplateResolver;
}
Also used : ClassLoaderTemplateResolver(org.thymeleaf.templateresolver.ClassLoaderTemplateResolver)

Example 48 with ClassLoaderTemplateResolver

use of org.thymeleaf.templateresolver.ClassLoaderTemplateResolver in project tutorials by eugenp.

the class Config method templateResolver.

@Bean
public ITemplateResolver templateResolver() {
    ClassLoaderTemplateResolver resolver = new ClassLoaderTemplateResolver();
    resolver.setPrefix("templates/sessionattrs/");
    resolver.setSuffix(".html");
    resolver.setTemplateMode(TemplateMode.HTML);
    resolver.setCharacterEncoding("UTF-8");
    return resolver;
}
Also used : ClassLoaderTemplateResolver(org.thymeleaf.templateresolver.ClassLoaderTemplateResolver) Bean(org.springframework.context.annotation.Bean)

Example 49 with ClassLoaderTemplateResolver

use of org.thymeleaf.templateresolver.ClassLoaderTemplateResolver in project dubion by valsamiq.

the class ThymeleafConfiguration method emailTemplateResolver.

@Bean
@Description("Thymeleaf template resolver serving HTML 5 emails")
public ClassLoaderTemplateResolver emailTemplateResolver() {
    ClassLoaderTemplateResolver emailTemplateResolver = new ClassLoaderTemplateResolver();
    emailTemplateResolver.setPrefix("mails/");
    emailTemplateResolver.setSuffix(".html");
    emailTemplateResolver.setTemplateMode("HTML5");
    emailTemplateResolver.setCharacterEncoding(CharEncoding.UTF_8);
    emailTemplateResolver.setOrder(1);
    return emailTemplateResolver;
}
Also used : ClassLoaderTemplateResolver(org.thymeleaf.templateresolver.ClassLoaderTemplateResolver)

Example 50 with ClassLoaderTemplateResolver

use of org.thymeleaf.templateresolver.ClassLoaderTemplateResolver in project ArTEMiS by ls1intum.

the class ThymeleafConfiguration method emailTemplateResolver.

@Bean
@Description("Thymeleaf template resolver serving HTML 5 emails")
public ClassLoaderTemplateResolver emailTemplateResolver() {
    ClassLoaderTemplateResolver emailTemplateResolver = new ClassLoaderTemplateResolver();
    emailTemplateResolver.setPrefix("mails/");
    emailTemplateResolver.setSuffix(".html");
    emailTemplateResolver.setTemplateMode("HTML5");
    emailTemplateResolver.setCharacterEncoding(CharEncoding.UTF_8);
    emailTemplateResolver.setOrder(1);
    return emailTemplateResolver;
}
Also used : ClassLoaderTemplateResolver(org.thymeleaf.templateresolver.ClassLoaderTemplateResolver) Description(org.springframework.context.annotation.Description) Bean(org.springframework.context.annotation.Bean)

Aggregations

ClassLoaderTemplateResolver (org.thymeleaf.templateresolver.ClassLoaderTemplateResolver)50 Test (org.junit.Test)18 SpringTemplateEngine (org.thymeleaf.spring5.SpringTemplateEngine)17 ArrayList (java.util.ArrayList)13 TemplateEngine (org.thymeleaf.TemplateEngine)13 Context (org.thymeleaf.context.Context)12 ITemplateResolver (org.thymeleaf.templateresolver.ITemplateResolver)12 FileTemplateResolver (org.thymeleaf.templateresolver.FileTemplateResolver)8 DefaultTemplateResolver (org.thymeleaf.templateresolver.DefaultTemplateResolver)4 Bean (org.springframework.context.annotation.Bean)3 HashMap (java.util.HashMap)2 LinkedHashSet (java.util.LinkedHashSet)2 Map (java.util.Map)2 IExpressionContext (org.thymeleaf.context.IExpressionContext)2 StandardLinkBuilder (org.thymeleaf.linkbuilder.StandardLinkBuilder)2 SpringWebFluxTemplateEngine (org.thymeleaf.spring5.SpringWebFluxTemplateEngine)2 AbstractConfigurableTemplateResolver (org.thymeleaf.templateresolver.AbstractConfigurableTemplateResolver)2 FileOutputStream (java.io.FileOutputStream)1 OutputStreamWriter (java.io.OutputStreamWriter)1 Writer (java.io.Writer)1