Taming Thymeleaf
Taming Thymeleaf
Practical Guide to building a web application with Spring Boot and Thymeleaf
About the Book
The book has been updated for Spring Boot 3!
Taming Thymeleaf will learn you about writing web applications with Spring Boot and Thymeleaf in no-time. The 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, ...
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, beautiful components based on Tailwind CSS.
Super-charge your learning now with Taming Thymeleaf!
Bundles that include this book
Table of Contents
-
1. What are Spring Boot and Thymeleaf?
- 2.1 Spring Framework
- 2.2 Spring Boot
- 2.3 Thymeleaf
-
2. Getting started
- 3.1 Prerequisites
- 3.2 Spring Initializer
- 3.3 Summary
-
3. Thymeleaf introduction
- 4.1 What is Thymeleaf?
- 4.2 Writing our first template
- 4.3 Writing our first controller
- 4.4 Thymeleaf expressions
- 4.5 Thymeleaf attributes
- 4.6 Preprocessing
- 4.7 Summary
-
4. Thyme Wizards
- 5.1 Cascading Style Sheets
- 5.2 Tailwind CSS
- 5.3 Application shell
- 5.4 Summary
-
5. Fragments
- 6.1 What are fragments?
- 6.2 Using fragments
- 6.3 Fragments with parameters
- 6.4 Fragments with HTML snippets as arguments
- 6.5 Inline separate SVG files
- 6.6 Homepage refactoring
- 6.7 Menu item components
- 6.8 Summary
-
6. Layouts
- 7.1 What is the Thymeleaf Layout Dialect?
- 7.2 Layouts with parameters
- 7.3 Page titles
- 7.4 Homepage refactoring
- 7.5 Summary
-
7. Controllers
- 8.1 What is a controller?
- 8.2 Exposing data to the view
- 8.3 Path parameters
- 8.4 Posting data
- 8.5 Support for other HTTP methods
- 8.6 Team and User controllers
- 8.7 Summary
-
8. Internationalization
- 9.1 Internationalization basics
- 9.2 Using a query parameter to select the language
- 9.3 Menu items translations
- 9.4 Summary
-
9. Database connection
- 10.1 Spring Data JPA
- 10.2 PostgreSQL database
- 10.3 Getting started with Spring Data JPA
- 10.4 Summary
-
10. Displaying data
- 11.1 Generate random users
- 11.2 Get users on the HTML page
- 11.3 Refactor the table using fragments
- 11.4 Use pagination
- 11.5 Hide columns on mobile
- 11.6 Summary
-
11. Forms
- 12.1 Form fields
- 12.2 Error messages
- 12.3 Custom error messages
- 12.4 Custom validator
- 12.5 Errors summary
- 12.6 Validation groups and order
- 12.7 Summary
-
12. Data editing
- 13.1 Add user button
- 13.2 Edit user data
- 13.3 Refactoring to fragments
- 13.4 Handling Optimistic Locking failure
- 13.5 Custom error pages
- 13.6 Summary
-
13. Delete
- 14.1 Using a dedicated URL
- 14.2 Using the DELETE HTTP method
- 14.3 Flash attributes
- 14.4 Summary
-
14. Security
- 15.1 Default Spring Security
- 15.2 Hardcoded password
- 15.3 User roles
- 15.4 Thymeleaf integration
- 15.5 Custom logon page
- 15.6 Users from database
- 15.7 Summary
-
15. Testing
- 16.1 Using @WebMvcTest
- 16.2 Using Cypress
- 16.3 Summary
-
16. Various tips and tricks
- 17.1 Open Session In View
- 17.2 StringTrimmerEditor
- 17.3 Global model attributes
- 17.4 File upload
- 17.5 Selecting a linked entity value
- 17.6 Dynamically adding rows
- 17.7 Custom editors and formatters
- 17.8 Date picker
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them