Learnings with Spring Boot and Thymeleaf

Creating a visually appealing webapplication from scratch with Spring Boot and Thymeleaf is pretty much straightforward and fast, if you take care of the following points:

Take care of conventions

  • Place your messages under src/main/resources/messages into the message.properties
  • Place static web content under src/main/resources/static (this will be the root directory for your web application for static content like images, CSS and JavaScript files)
  • The Thymeleaf 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!

One thought on “Learnings with Spring Boot and Thymeleaf

  1. Pingback: Thymeleaf project structure – day 1 – Hello World | Engineering Experiments

Comments are closed.