org.thymeleaf.spring4.SpringTemplateEngine Java Examples

The following examples show how to use org.thymeleaf.spring4.SpringTemplateEngine. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SpringMailConfig.java    From konker-platform with Apache License 2.0 5 votes vote down vote up
@Bean
public SpringTemplateEngine emailTemplateEngine(MessageSource messageSource) {
	final SpringTemplateEngine templateEngine = new SpringTemplateEngine();
       templateEngine.addTemplateResolver(textTemplateResolver());
       templateEngine.addTemplateResolver(htmlTemplateResolver());
       templateEngine.addTemplateResolver(stringTemplateResolver());
       templateEngine.setTemplateEngineMessageSource(messageSource);
       return templateEngine;
}
 
Example #2
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf template engine with Spring integration")
public SpringTemplateEngine templateEngine(final TemplateResolver templateResolver)
throws Exception {
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.setTemplateResolver(templateResolver);

    engine.addDialect(new SpringSecurityDialect());
    engine.addDialect(new LayoutDialect(new GroupingStrategy()));
    engine.afterPropertiesSet();
    return engine;
}
 
Example #3
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf template engine with Spring integration")
public SpringTemplateEngine templateEngine(final TemplateResolver templateResolver)
throws Exception {
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.setTemplateResolver(templateResolver);

    engine.addDialect(new SpringSecurityDialect());
    engine.addDialect(new LayoutDialect(new GroupingStrategy()));
    engine.afterPropertiesSet();
    return engine;
}
 
Example #4
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example #5
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf template engine with Spring integration")
public SpringTemplateEngine templateEngine(final TemplateResolver templateResolver)
throws Exception {
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.setTemplateResolver(templateResolver);

    engine.addDialect(new SpringSecurityDialect());
    engine.addDialect(new LayoutDialect(new GroupingStrategy()));
    engine.afterPropertiesSet();
    return engine;
}
 
Example #6
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example #7
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf template engine with Spring integration")
public SpringTemplateEngine templateEngine(final TemplateResolver templateResolver)
throws Exception {
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.setTemplateResolver(templateResolver);

    engine.addDialect(new SpringSecurityDialect());
    engine.addDialect(new LayoutDialect(new GroupingStrategy()));
    engine.afterPropertiesSet();
    return engine;
}
 
Example #8
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ThymeleafViewResolver thymeleafViewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example #9
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf template engine with Spring integration")
public SpringTemplateEngine templateEngine(final TemplateResolver templateResolver)
throws Exception {
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.setTemplateResolver(templateResolver);

    engine.addDialect(new SpringSecurityDialect());
    engine.addDialect(new LayoutDialect(new GroupingStrategy()));
    engine.afterPropertiesSet();
    return engine;
}
 
Example #10
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ThymeleafViewResolver thymeleafViewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example #11
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf template engine with Spring integration")
public SpringTemplateEngine templateEngine(final TemplateResolver templateResolver)
throws Exception {
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.setTemplateResolver(templateResolver);

    engine.addDialect(new SpringSecurityDialect());
    engine.addDialect(new LayoutDialect(new GroupingStrategy()));
    engine.afterPropertiesSet();
    return engine;
}
 
Example #12
Source File: MailService.java    From tutorials with MIT License 5 votes vote down vote up
public MailService(JHipsterProperties jHipsterProperties, JavaMailSender javaMailSender,
        MessageSource messageSource, SpringTemplateEngine templateEngine) {

    this.jHipsterProperties = jHipsterProperties;
    this.javaMailSender = javaMailSender;
    this.messageSource = messageSource;
    this.templateEngine = templateEngine;
}
 
Example #13
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf template engine with Spring integration")
public SpringTemplateEngine templateEngine(final TemplateResolver templateResolver)
throws Exception {
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.setTemplateResolver(templateResolver);

    engine.addDialect(new SpringSecurityDialect());
    engine.addDialect(new LayoutDialect(new GroupingStrategy()));
    engine.afterPropertiesSet();
    return engine;
}
 
Example #14
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ThymeleafViewResolver thymeleafViewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example #15
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf template engine with Spring integration")
public SpringTemplateEngine templateEngine(final TemplateResolver templateResolver)
throws Exception {
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.setTemplateResolver(templateResolver);

    engine.addDialect(new SpringSecurityDialect());
    engine.addDialect(new LayoutDialect(new GroupingStrategy()));
    engine.afterPropertiesSet();
    return engine;
}
 
Example #16
Source File: ThymeleafConfig.java    From portal-de-servicos with MIT License 5 votes vote down vote up
@Bean
public ThymeleafViewResolver xmlThymeleafViewResolver(SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setContentType(APPLICATION_XML_VALUE);
    resolver.setExcludedViewNames(new String[]{"*.html"});
    return resolver;
}
 
Example #17
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf template engine with Spring integration")
public SpringTemplateEngine templateEngine(final TemplateResolver templateResolver)
throws Exception {
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.setTemplateResolver(templateResolver);

    engine.addDialect(new SpringSecurityDialect());
    engine.addDialect(new LayoutDialect(new GroupingStrategy()));
    engine.afterPropertiesSet();
    return engine;
}
 
Example #18
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ThymeleafViewResolver thymeleafViewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example #19
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
    public SpringTemplateEngine templateEngine(final ServletContextTemplateResolver templateResolver) {
        SpringTemplateEngine engine = new SpringTemplateEngine();
        engine.setTemplateResolver(templateResolver);
//        engine.setEnableSpringELCompiler(true);

        engine.setAdditionalDialects(new HashSet<IDialect>() {{
            add(new LayoutDialect());
            add(new SpringSecurityDialect());
        }});
        return engine;
    }
 
Example #20
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf template engine with Spring integration")
public SpringTemplateEngine templateEngine(final TemplateResolver templateResolver)
throws Exception {
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.setTemplateResolver(templateResolver);

    engine.addDialect(new SpringSecurityDialect());
    engine.addDialect(new LayoutDialect(new GroupingStrategy()));
    engine.afterPropertiesSet();
    return engine;
}
 
Example #21
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
    public SpringTemplateEngine templateEngine(final ServletContextTemplateResolver templateResolver) {
        SpringTemplateEngine engine = new SpringTemplateEngine();
        engine.setTemplateResolver(templateResolver);
//        engine.setEnableSpringELCompiler(true);

        engine.setAdditionalDialects(new HashSet<IDialect>() {{
            add(new LayoutDialect());
            add(new SpringSecurityDialect());
        }});
        return engine;
    }
 
Example #22
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ThymeleafViewResolver thymeleafViewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example #23
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf template engine with Spring integration")
public SpringTemplateEngine templateEngine(final TemplateResolver templateResolver)
throws Exception {
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.setTemplateResolver(templateResolver);

    engine.addDialect(new SpringSecurityDialect());
    engine.addDialect(new LayoutDialect(new GroupingStrategy()));
    engine.afterPropertiesSet();
    return engine;
}
 
Example #24
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ThymeleafViewResolver thymeleafViewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example #25
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf template engine with Spring integration")
public SpringTemplateEngine templateEngine(final TemplateResolver templateResolver)
throws Exception {
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.setTemplateResolver(templateResolver);

    engine.addDialect(new SpringSecurityDialect());
    engine.addDialect(new LayoutDialect(new GroupingStrategy()));
    engine.afterPropertiesSet();
    return engine;
}
 
Example #26
Source File: ThymeleafConfig.java    From portal-de-servicos with MIT License 5 votes vote down vote up
@Bean
public ThymeleafViewResolver thymeleafViewResolver(SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setContentType(TEXT_HTML_VALUE);
    resolver.setExcludedViewNames(new String[]{"*.xml"});
    return resolver;
}
 
Example #27
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ThymeleafViewResolver thymeleafViewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example #28
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ThymeleafViewResolver thymeleafViewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example #29
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@Description("Thymeleaf template engine with Spring integration")
public SpringTemplateEngine templateEngine(final TemplateResolver templateResolver)
throws Exception {
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.setTemplateResolver(templateResolver);

    engine.addDialect(new SpringSecurityDialect());
    engine.addDialect(new LayoutDialect(new GroupingStrategy()));
    engine.afterPropertiesSet();
    return engine;
}
 
Example #30
Source File: ThymeleafConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
    public SpringTemplateEngine templateEngine(final ServletContextTemplateResolver templateResolver) {
        SpringTemplateEngine engine = new SpringTemplateEngine();
        engine.setTemplateResolver(templateResolver);
//        engine.setEnableSpringELCompiler(true);

        engine.setAdditionalDialects(new HashSet<IDialect>() {{
            add(new LayoutDialect());
            add(new SpringSecurityDialect());
        }});
        return engine;
    }