Below is my class in which i had to use both @Configuration
and @Controller
as there should be only one instance of Thymeleaf
in the e
Take look at Spring Boot documentation typical layout
Also this article SOLID Programming Principles
And look at Spring Boot guide Spring Boot Thymeleaf (you don't need your @Bean configurations)
In two words you should separate
1. MyThymeleafConfig
configuration
2. TemplateController
with viewTemplates()
and another endpoints