package example;

import example.view.MyDialect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.thymeleaf.spring4.SpringTemplateEngine;
import org.thymeleaf.templateresolver.ITemplateResolver;

@SpringBootApplication
public class Application {

    @Autowired
    ITemplateResolver templateResolver;

    @Bean
    public SpringTemplateEngine templateEngine() {
        SpringTemplateEngine templateEngine = new SpringTemplateEngine();
        templateEngine.setEnableSpringELCompiler(true);
        templateEngine.setTemplateResolver(templateResolver);
        templateEngine.addDialect(new MyDialect());
        return templateEngine;
    }

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

@@ -46,71 +46,8 @@
 ct;%0A
-import org.springframework.beans.factory.annotation.Autowired;%0A
 impo
@@ -218,558 +218,135 @@
 an;%0A
-import org.thymeleaf.spring4.SpringTemplateEngine;%0Aimport org.thymeleaf.templateresolver.ITemplateResolver;%0A%0A@SpringBootApplication%0Apublic class Application %7B%0A%0A    @Autowired%0A    ITemplateResolver templateResolver;%0A%0A    @Bean%0A    public SpringTemplateEngine templateEngine() %7B%0A        SpringTemplateEngine templateEngine = new SpringTemplateEngine();%0A        templateEngine.setEnableSpringELCompiler(true);%0A        templateEngine.setTemplateResolver(templateResolver);%0A        templateEngine.addDialect(new MyDialect());%0A        return templateEngine
+%0A@SpringBootApplication%0Apublic class Application %7B%0A%0A    @Bean%0A    public MyDialect myDialect() %7B%0A        return new MyDialect()
 ;%0A  

add MyDialect Bean