UI frameworks

When you are working with Spring MVC, you have the option to choose from a huge set of technologies to build your web pages. Depending on what framework you have chosen, you will need to add the corresponding configuration, in order to let Spring know about your choice.

As we know, Spring supports configuration by code, so you will need to add a few annotations and/or configuration classes to make your frameworks work. If you want to avoid these steps, you can use Thymeleaf; this framework can be easily integrated as part of an existing Spring application including the Thymeleaf starter dependency. There are different lines of codes to be used depending upon the tools being used which are as follows:

  • The dependency when Gradle is used is as follows:
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
  • The dependency when Maven is used is as follows:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

Once the application starts, Spring Boot will do all of the boring stuff for you, preparing your application for using Thymeleaf.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.210.102