【SpringBoot】Spring Boot项目整合FreeMarker模板

Spring Boot项目整合FreeMarker模板

记录

freemarker

Apache FreeMarker™ is a *template engine*: a Java library to generate text output (HTML web pages, e-mails, configuration files, source code, etc.) based on templates and changing data. Templates are written in the FreeMarker Template Language (FTL), which is a simple, specialized language (not a full-blown programming language like PHP). Usually, a general-purpose programming language (like Java) is used to prepare the data (issue database queries, do business calculations). Then, Apache FreeMarker displays that prepared data using templates. In the template you are focusing on how to present the data, and outside the template you are focusing on what data to present.

FreeMarker 是一款模模板引擎,一种基于模板和要改变的数据, 并用来生成输出文本(HTML网页,电子邮件,配置文件,源代码等)的通用工具。 它不是面向最终用户的,而是一个Java类库,是一款程序员可以嵌入他们所开发产品的组件。

FreeMarker基于模板和要改变的数据,用来生成输出文本

模板编写为FreeMarker Template Language (FTL)

模板显示已经准备好的数据。在模板中,可以专注于如何展现数据, 而在模板之外可以专注于要展示什么数据。

在这里插入图片描述

Spring Boot项目整合FreeMarker模板。
新建项目,在项目中加入Freemarker依赖

 <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值