springboot-freemarker?

What is freemarker?

freemarker is a template engine that renders on the server side. The same paragraph has: thymeleaf jsp and so on.

Don't talk nonsense, just work directly:

1. Dependency, open pom.xml to add dependency

<!--freemarker依赖-->
<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>

2. Folder creation

Create the directory templates under resources, right click on it, new→Html File 

Although successful, but still want .html suffix into .ftl standard freemarker extension, otherwise you will not be prompted to write the label when the [Behind his] [Behind his] [Behind his]

 

Finally, if you need to buy a server to play, please poke → 

https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=tqpvz8yl to
receive coupons.

Guess you like

Origin blog.csdn.net/qq_36338555/article/details/83190181