Skip to content

Urunov/SpringBoot-Thymeleaf-FrontBackend-Projects

Repository files navigation

SpringBoot-Thymeleaf-Projects

spring_boott

Project1- SpringBoot-Thymeleaf-Book-Project-Mapping-NoDB

  • We'll start by showing how to display elements of a List in a Thymeleaf page and how to bind a list of objects as user's inputs in a Thymeleaf form.

  • Here, we've added List of Book objects as a model attribute sent to the view, where we'll display it using an HTML table:

    Title Author
    No Books Available
    Title Author

    AddBook

Project2-SpringBoot-Thymeleaf-Hibernate-Planet-Project

  • Working with Enums in Thymeleaf

  • Planet Project Let's start by adding the Spring Boot starter for Thymeleaf to our pom.xml file:

    org.springframework.boot spring-boot-starter-thymeleaf RELEASE
  • We're going to be working with widgets that have a few choices of color, so let's define our Color enum:

     public enum Solor {
       MERCURY, VENUS, EARTH, MARS, JUPITER, SATURN, URANUS, NEPTUNE
     }
    
  • Now, let's create our Widget class:

     public class Planet {
       private String name;
       private Solar solar;
    
      // Standard getters/setters
     }
    

Reference Materials

  1. https://www.baeldung.com/thymeleaf-list
  2. https://frontbackend.com/thymeleaf/thymeleaf-tutorial