Annotated a class with @Configuration and @Controller. Need help in refactoring

前端 未结 6 616
一整个雨季
一整个雨季 2021-01-17 15:49

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

6条回答
  •  暖寄归人
    2021-01-17 16:10

    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

提交回复
热议问题