Developing application using Spring boot and Thymeleaf is simpler and quick, if you follow these convention. Thymeleaf requires a specific project structure which helps to render views and refer items without getting into error.
Since we are using Spring Boot, because we’ve included the dependency spring–boot–starter–thymeleaf in our Maven POM for the project, so Spring Boot will do some things automatically for us.
By default, Spring Boot configures the Thymeleaf template engine to read template files from src/main/resources/templates .
Effectively, you as the developer just need to start making Thymeleaf templates and dropping them into src/main/resources/templates.
- Messages to placed inside src/main/resources/messages into the message.properties
- Most importantly templates must go into src/main/resources/templates and if required, subdirectories there.
Be clean on configuration
- Use src/main/resources/application.properties as few as possible
- Use src/main/resources/applicationContext.xml as few as possible
- Try to use annotation-based configuration as much as possible
All those points are very important, if you don’t follow them, you will get into trouble when you try to run your application standalone and not from your IDE!