Taming Thymeleaf

Practical Guide to building a web application with Spring Boot and Thymeleaf

About the book

Taming Thymeleaf will teach you about writing web applications with Spring Boot and Thymeleaf in no-time. This book teaches you step-by-step how to get started with those technologies and build a fully fledged web application including security, validation, internationalization, testing and more.

Thymeleaf is an amazing technology for building server-side HTML using the Java eco-system. Combined with Spring Boot, it is really a killer combo for a productive development environment. Learn how to structure your code so your application can evolve for years to come. As HTML will always be there, you can do this without having to re-write your frontend every six months for the latest JavaScript framework.

The application that is built in the book not only functions great. It also looks amazing as it is based on Tailwind UI. These are beautiful components based on Tailwind CSS.

The book has chapters about the following topics
  • Getting started with Spring Boot and Thymeleaf with a live reload setup
  • Thymeleaf syntax
  • Fragments: build re-usable snippets of HTML
  • Layouts: define page layouts for common elements like headers, footers and menu's
  • Spring MVC Controllers
  • Internationalization: support multiple languages in your application
  • Connection with a database using Spring Data JPA
  • Displaying data in lists or tables with pagination
  • Form fields and validation
  • Security: integration with Spring Security
  • Testing: using Cypress for end-to-end tests

The full table of contents of the book can be seen on the Leanpub page.

There is also a sample chapter available for free!

Super-charge your learning now with Taming Thymeleaf!

Contact me via wim.deblauwe@gmail.com if you bought the paper book and want to get the e-book for free.
You can also get the book with a discount when buying the Modern Thymeleaf Bundle which includes this book and Modern frontends with htmx.

What people are saying

Bienvenu Boleko
Java Developer

I personally wanted to thank you for your book Taming Thymeleaf which I bought on Amazon this week. You are an excellent author and I believe that through your book I will move forward perfectly with Thymeleaf which I have been enjoying for a while.

Once again thank you for this excellent technological gift. Keep writing more about Java.

Juan Resendiz
Software Developer

I've been using Taming Thymeleaf for the past year or so, and it's been a game-changer. Not only has it helped me grow my career, but it's also made me a more productive developer by using it as my go-to, even before StackOverflow. And in the tech world we know that says a lot!

What Wim shows us is the beauty of working with such light frameworks making Thymeleaf, Tailwind, and Alpine js come together just perfect. He explains it very well which in turn makes it so easy to learn.

As someone who spends most of their time writing code, this is huge for me! And if you're interested in learning spring-boot with thymeleaf this is a must-have. Thank you for this book!

Philip Riecks
IT-Consultant

Wim's Taming Thymeleaf book is a must-read for everyone using Thymeleaf together with Spring Boot.

I really enjoyed building the nice-looking and feature-rich sample application while reading the book. Along the way, you'll learn how to master internationalization, security, entity updates, error handling, validation, and much more.

On top of this, Wim reveals so many hidden gems of Spring's excellent Thymeleaf integration that your productivity with this tech stack will significantly increase.

In the end, you'll have a blueprint for a state-of-the-art Thymeleaf and Spring Boot application. I'm actively using it as my go-to reference whenever I try to solve X with Thymeleaf and Spring Boot. You won't find such great explanations and examples on Stack Overflow.

Frederik Hahne
Software Developer

The book is a comprehensive guide on how to write large, maintainable web applications with spring boot, Thymeleaf, tailwind css and minimal javascript with alpine.js.

Starting out simple the author shows how to structure your code and shows common pitfalls. You learn how to test your application from back to front with unit- integration and end-2-end tests.

If you are already familiar with Thymeleaf you will learn a lot of tricks on how to build reusable, self-contained components and common layouts such that adding new pages and functions are a breeze. You will be surprised how much is possible with "just" HTML, css and a tiny bit of javascript when necessary.

Oliver Eisenbarth
Software Developer

Great writing - even form validation was engaging. Excellent chapter structure and size and (imho) solid combination of technologies. I wish I had it when starting with Spring Boot, alone for the smooth introduction of Spring Security, Testcontainers and Spring Data.

It also offers quite a lot of knowledge bits one picks up with time, like using value classes for IDs, in a very well-rounded package. To put it short: A lot of value for the money! 🙌

Oliver Tigges
Software Developer

If you use Spring Boot in combination with Thymeleaf, this book is perfect to understand the basic concepts as well as to learn best practices and tips for effective usage. Wim writes very practical, precise and compact and with really helpful code examples. The book helped me tremendously to set up and design a new Spring Boot & Thymeleaf project after a long break from the Java world.

Application demo

There is a demo of the application that you build throughout the book running at https://taming-thymeleaf.cloud.widit.be/.

Application screenshots

Learn to create forms

Example form to create a user account Validation of form content File upload to set an avatar image on a user Show a modal dialog to confirm deletion of a user

Pagination

Use pagination to allow the user to navigate through a big result set

Login/Security

Custom login page

Testing

Running Cypress tests for end-to-end testing of the Thymeleaf application

Dynamic interaction

Client-side interaction using the AlpineJS JavaScript framework to avoid page reloads when the interaction needs to more dynamic