springboot-freemarker?

freemarker是啥?

freemarker是一款模板引擎,在服务器端渲染.同款有:thymeleaf jsp  and so on.

废话不说,直接干活:

1,依赖,打开pom.xml 添加依赖

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

2,文件夹创建

在resources下创建目录 templates 在此上面右键 new→Html File 

虽然成功了,但是还是要把.html 的后缀改成 .ftl 标准的 freemarker 后缀名 ,不然你写标签的时候不会提示的[捂脸][捂脸][捂脸]

最后有需要购买服务器玩的,请戳→ 

https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=tqpvz8yl
领取优惠券.

猜你喜欢

转载自blog.csdn.net/qq_36338555/article/details/83190181
今日推荐