
Explore Thymeleaf as a server side templating engine that works with Spring MVC and Spring Boot, using standard HTML with no custom tags.
Discover how Thymeleaf lets you bind real data to existing HTML by adding extra attributes, enabling browser previews and designer workflows without changing the HTML structure.
Install thymeleaf by adding its dependency to your Maven pom.xml for both traditional spring mvc and spring boot. Create a new spring project with thymeleaf and validate dependencies with Maven.
Access support through the course Q&A and dashboard, view or answer questions, review the course with star ratings, and contact the instructor on YouTube.
Create a simple controller to render a home page in a Spring Boot app, relying on Thymeleaf by default when the Thymeleaf dependency is present, with no additional view configuration.
Identify the default Thymeleaf template location in a Spring Boot project, placing html files under src/main/resources/templates and static assets under src/main/resources/static, and reference the Thymeleaf documentation.
Create your first html file as a homepage in source main resources/templates, then view hello world in the browser via thymeleaf with no additional configuration.
Learn to turn an HTML file into a Thymeleaf template by adding the xmlns:th declaration to the HTML tag, so th: attributes work with a single namespace.
Learn to create valid XHTML that is well-formed XML for Spring MVC and Thymeleaf, diagnose parsing errors via stack traces, and enforce correct HTML handling with doctype and dependencies.
Learn how the th:text tag in thymeleaf uses expressions to dynamically replace text at runtime, and how a controller-passed username renders in the view.
Learn how Thymeleaf evaluates variables against the model in th:text attributes, using ${...} expressions, string literals, and plus concatenation to render dynamic content such as a username.
Learn to use the th:text attribute with the span tag to dynamically replace the username in a paragraph, avoiding duplicating text and enabling inline data display.
Extract data from a model map and render a profile view, displaying title, first name, surname, date of birth, and a description with HTML in the template.
Discover how to concatenate strings in Thymeleaf with pipe syntax, inserting model attributes inside a larger string while handling spaces and curly brackets expressions.
Explore how Thymeleaf escapes HTML by default with th:text, preventing HTML injection. Use th:utext to render unescaped HTML, as with bold tags, while considering security risks.
Format the date of birth with thymeleaf hash dates and its format method, and uppercase a surname with hash strings, while choosing text versus u text for safe html.
Learn how to create navigation links in Thymeleaf for a Spring Boot app, using th:href to map to the application root and prevent 404 errors.
create dynamic links to the user profile by passing the user id from the controller to the view and constructing a thymeleaf link to profile.html?id=${user.id}.
Explore a cleaner Thymeleaf syntax to pass multiple URL parameters in a path by bracketed key=value pairs, such as id and other keys, for Spring MVC and Spring Boot.
Learn to loop through a languages list in a Thymeleaf template using th:each and th:text to render items from a Java list in a user profile, including empty-list handling.
Learn to use Thymeleaf th:if to conditionally render blocks based on a variable, such as model.languages.size, showing a list for three or more languages and a paragraph for fewer.
Learn to use the ternary operator in Thymeleaf to display you speak X languages, replacing X with the language count or the phrase three or more.
Include a CSS file in your Thymeleaf project by placing it in the static resources folder and referencing it with Thymeleaf syntax to style the page.
Learn how to embed an image in a Thymeleaf Spring Boot page by creating a static images folder and using th:src to resolve the image path.
Learn how to create reusable html blocks with thymeleaf fragments in Spring MVC, by placing fragment files in templates/fragments and injecting them as the main menu and footer across pages.
Apply Thymeleaf fragments to a profile page by replacing a placeholder div with a fragment from fragments/menu, named Main-Dash-Menu; demonstrate replacing entire sections, including head fragments, across pages.
Create a local variable in Thymeleaf with th:with to concatenate title, first name, and uppercase surname, then reuse it across the page with proper scope.
Apply dynamic styles with Thymeleaf by passing a color from the user profile into the model and binding it to the style attribute to color text at runtime.
Integrate a designer-provided html form into a spring mvc boot project by copying files, creating a simple controller, ensuring valid html, and handling form submission.
Walkthrough of the solution to practical exercise 1 in Thymeleaf with Spring MVC and Spring Boot, showing how to fix template issues and apply css and images.
populate an html select dynamically by sending a map of three-letter country codes to names from the controller and rendering options with thymeleaf th:each.
Create a dedicated form model as a backing bean to bind user input to a spring mvc form, mapping fields like username, password, repeat password, and address.
Bind the form fields to a model using the *{field} syntax, mapping inputs like username and password to model attributes, and validate binding before submission.
Send form data to a Spring MVC controller via post, map to a save user method, validate the model, and show errors or a user added confirmation.
Implement a custom Spring MVC validator for matching passwords. Hook it into the controller, expose errors via BindingResult, and show messages from messages.properties on the form.
Demonstrates displaying form validation errors with Thymeleaf in a Spring MVC and Spring Boot app, including binding errors, using the errors attribute, and password match validation.
Learn to integrate Thymeleaf into a traditional Spring MVC application and convert from JSP to Thymeleaf using the Bookstop project, with setup in Eclipse and embedded Tomcat.
Add thymeleaf dependencies to the pom.xml by including the thymeleaf core library and thymeleaf spring3 artifact with version 3.0.6 release, then build the project to fetch the dependencies.
Configure the dispatcher to use Thymeleaf by adding a Thymeleaf template resolver, template engine, and Thymeleaf view resolver, with a templates prefix and .html suffix, JSP fallback included.
Learn to run both thymeleaf and jsp in a single spring mvc boot project using a view names attribute to route templates, with templates folder included in the build.
Create your first thymeleaf html template to display books and a hello placeholder, switching from jsp by configuring the controller to render thymeleaf templates under /templates.
Execute practical exercise 2 by converting existing jsp pages to thymeleaf in a springmvc and spring boot setup, copying and pasting the book display file, and renaming jsp to thymeleaf.
Walkthrough of practical exercise 2 shows upgrading from JSP to Thymeleaf within Spring MVC and Spring Boot, adding style sheets, creating header and footer fragments, and iterating data with Thymeleaf.
Practice creating an html book page, bind fields, and add a new book, then view it on the old books page and compare with the final workspace.
Walk through converting the add new book page from gsp to a thymeleaf template, updating the Spring MVC controller and post handling, then run and verify the thymeleaf version.
Complete the exercise by testing the add-to-cart flow and confirming the JSP to Thymeleaf conversion for the view books and other book pages.
Discover how a defined layout streamlines web page design by standardizing header and footer across pages, reducing duplication, and placing page-specific content in a dedicated slot.
The lecture demonstrates structuring a page with Thymeleaf by creating a standard layout that houses header and footer fragments and a content fragment inserted into the layout.
Create a standard Thymeleaf layout HTML as a fragment, and wire pages to include or replace content with defined content blocks to render dynamic page content.
Fix the page title by passing the correct title into the standard layout template, and verify the Dispell Books page renders with the header and photo after restarting the app.
Learn how to pass a title parameter to a Thymeleaf fragment within a standard layout, and render dynamic page titles by supplying the parameter when including the fragment.
If you are building web front-ends with Spring Boot or Spring MVC, and you're still using JSP (Java Server Pages) then this course is for you. Thymeleaf is a great templating engine which replaces JSP, and you can easily use it in any Spring MVC or Spring Boot application. Unlike JSP it's a pleasure to use. With Thymeleaf you work with regular HTML, which means that a lot of the frustration of JSP is taken away.
If you've been given a set of HTML and CSS templates to use for a project, Thymeleaf lets you integrate them with ease. Or if you're building the functionality and handing off to a web-designer, they'll be able to work with your code with no knowlege of Java or Spring.
In this course you'll learn:
How Thymeleaf allows you to seamlessly work with Web Designers
How to integrate your code into standard HTML/XHTML without breaking the design
How to manage forms, validation and error handling
How to convert a legacy JSP project to Thymeleaf
By the end of this course you'll be confidently able to build functional and effective front-ends for your Spring web applications.
As well as teaching programming, I've been building websites with Spring for a number of years, and I started using Thymeleaf about 3 years, ago. And I'd never go back! Amongst other things I find Thymeleaf sites much easier to support and maintain as application requirements change, and I think that's why I'm so much of a fan of it!