Thymeleaf Tutorials & Protips

How to access data in Thymeleaf templates

Learn how to access Spring model attributes, request parameters, session attributes, and Spring beans in Thymeleaf templates.

Spring BootThymeleaf

Displaying a Custom Error Page in Spring Boot

A quick guide to learn how to display a custom error page in a Spring Boot web application.

Spring BootThymeleaf

Spring Boot and Thymeleaf File Upload Example

A step-by-step article to learn how to upload a file in Spring Boot and Thymeleaf web application.

Spring BootThymeleaf

Working with Thymeleaf Layout Dialect in Spring Boot

A detailed article to learn how to use Thymeleaf Layout Dialect in a Spring Boot web application to build layouts and reusable templates.

Spring BootThymeleaf

How to use fragments in Thymeleaf

A quick guide to learn how to use fragments in Thymeleaf templates.

Thymeleaf

HTML Form Handling in Thymeleaf and Spring Boot

A complete guide to learn how to use HTML forms in a Thymeleaf template and how to handle the form submission using Spring Boot.

Spring BootThymeleaf

Setting up a JavaScript variable in Thymeleaf

A quick guide to learn what is JavaScript inlining and how to use it to set a JavaScript variable by in Thymeleaf.

Thymeleaf

How to get query string parameters in Thymeleaf

A quick article to learn how to get query string parameters in Thymeleaf templates.

Thymeleaf

How to get session attributes in Thymeleaf

A quick guide to learn how to access session attributes in Thymeleaf templates.

Thymeleaf

How to dynamically add/remove CSS classes in Thymeleaf

A quick guide to learn how to dynamically add or remove a CSS class in Thymeleaf.

Thymeleaf

Iterating through Map, List, Set, and Array in Thymeleaf

A quick guide to learn how to map through an iterator like Map, List, Set, and Array in Thymeleaf.

Thymeleaf

How to get the current environment in Thymeleaf

A quick article to learn how to get the current environment of the Spring Boot application in a Thymeleaf template.

Thymeleaf

Working with Enum Values in Thymeleaf

A quick article to learn how to display and compare enum values in Thymeleaf.

Thymeleaf

How to set and use a local variable in Thymeleaf

A short guide to learn how to set and use a local variable in Thymeleaf template engine.

Thymeleaf

How to conditionally add attributes in Thymeleaf

A quick article to learn how to conditionally add boolean attributes like checked and selected in Thymeleaf.

Thymeleaf

How to construct URLs in Thymeleaf

A quick tutorial to learn how to constructor different kinds of URLs in Thymeleaf templates.

Thymeleaf

How to check if a variable is defined in Thymeleaf

A quick article to learn how to check if a certain variable is defined in Thymeleaf.

Thymeleaf

How to handle null values in Thymeleaf

A quick guide to learn how to handle null values in Thymeleaf templates.

Thymeleaf

How to use Custom HTML5 Attributes in Thymeleaf

A quick guide to learn how to create HTML5 custom attributes using Thymeleaf template engine.

Thymeleaf

How to use conditionals in Thymeleaf

A quick guide to learn how to use conditional statements like if-else, switch, and ternary operator in Thymeleaf.

Thymeleaf

✨ Learn to build modern web applications using JavaScript and Spring Boot

I started this blog as a place to share everything I have learned in the last decade. I write about modern JavaScript, Node.js, Spring Boot, core Java, RESTful APIs, and all things web development.

The newsletter is sent every week and includes early access to clear, concise, and easy-to-follow tutorials, and other stuff I think you'd enjoy! No spam ever, unsubscribe at any time.