Taming 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.

What people are saying

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.

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