Friday, July 13, 2018

Spring boot web application with thymeleaf


In this article we will see a sample spring boot web application with front end as thymeleaf. To know more about thymeleaf, click here.

Note you can use any other view technology like JSP instead of thymeleaf as per your requirement

Project structure -

pom.xml


Application.java


ApplicationController.java



Static resources, like HTML or JavaScript or CSS, can easily be served from your Spring Boot application just by placing at "/static" (or "/public"). In our case index.html.

index.html
src/main/resources/static/index.html


home.html
src/main/resources/templates/home.html



Output -