Setting up a controller and configuring our project
Referring to the Thymeleaf Documentation
Making an HTML file a Thymeaf template
How to create valid XHTML code
the th:text tag
Evaluating expressions with variables
Using th:text with the Span tag
Extracting data from a model map
Displaying HTML with Thymeleaf
Formatting dates and strings with Utility Objects
Creating dynamic links
Links with multiple parameters
Looping through collections
Choosing whether to display an HTML block
Using the ternary operator
Including CSS files in your Thymeleaf project
Creating fragments - re-useable HTML blocks
Creating local variables
Applying dynamic styles
Introducing the challenge for this chapter and practical exercise 1
Walkthrough of solution to practical exercise 1
Populating an HTML Select dynamically
Designing a backing bean object
Binding a backing bean to an HTML form
Sending form data to a controller
Validation and Representation
Displaying validation errors
Exploring the case study - a Spring MVC Project
Adding Thymeleaf dependencies into our project
Configuring the project to use Thymeleaf
Using both Thymeleaf and JSP in the same project
Creating our first Thymeleaf HTML template
Practical exercise 2
Walkthrough of practical exercise 2
Practical exercise 3
Walkthrough of practical exercise 3
Wrapping up the exercise
Why we might want to use a page layout
Structuring a page
Creating the layout html file
Testing the layout
Passing parameters through to a fragment
You will need some basic experience having created websites in either SpringMVC or Spring Boot to do this course. As long as you know how to build a simple controller, and to pass data to a view using a model, you'll be able to follow along.
Some familiarity with HTML will be helpful, but you certainly don't need to be an HTML expert. Knowing what the common tags such as DIV, SPAN, H1, P, TABLE , TR, TD etc do, and how to use them will be good enough
Although this course teaches you how to upgrade from using JSP, you don't need to have written any JSP code to do this course - you can follow along and learn the better way instead!
No prior knowlege of Thymeleaf is needed. As long as you have basic familiarity with a modern Java IDE such as Eclipse or IntelliJ, then you'll be able to work along with me. On this course I provide you with lots of sample code, and I also take you through setting up and configuring Thymeleaf.
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!
Who this course is for:
Java web developers who want to upgrade their JSP skills
Anyone building websites with Spring Boot or Spring MVC
Anyone needing to create a web-front end for existing Spring projects
Having worked for over 20 years as a professional programmer, mainly in banking, Matt now teaches for Virtual Pair Programmers. His specialist areas are JavaEE, Android, Hadoop and NoSQL. Matt's currently working on a Clojure project, which he finds an enjoyable challenge!
Outside of work, Matt enjoys cycling, but prefers going downhill to uphill, and he also plays the piano… very badly.
Virtual Pair Programmers are here to help you take your programming skills to the next level. We're a group of enthusiastic software trainers who are all professional developers, and have a really practical approach to learning - our courses are full of real world case studies and hands on examples. We teach what you need to know to be productive in the workplace and to get the job done, rather than going through each feature turn by turn.