Error Messages
Learn how to add validation messages for validation errors in the form.
We'll cover the following...
We'll cover the following...
Thymleaf has the #fields.hasErrors method available in templates that allow us to check whether there is a validation error on a field.
Adding validation to firstName
We can apply this to the firstName property, for example:
- An extra
<div>is added that contains the SVG error icon. By usingth:if="${#fields.hasErrors('fir