Get Users on the HTML Page

Learn how to display the generated users in our database on the UI.

Main steps

We need to take three steps for this:

  1. Reyrieve the users from the database.
  2. Put the users in the model that Thymeleaf uses to render the HTML.
  3. Generate table rows in the Thymeleaf template for each of the users.

Get users from the database

To get the users from the database, we will update UserService with a getAllUsers method as following:

Get hands-on with 1000+ tech skills courses.