springboot+freemarker
springboot添加freemarker支持
1、application.properties中添加配置
#freemarker config
spring.freemarker.allow-request-override=false
spring.freemarker.cache=false
spring.freemarker.check-template-location=true
spring.freemarker.charset=UTF-8
spring.freemarker.content-type=text/html
spring.freemarker.expose-request-attributes=false
spring.freemarker.expose-session-attributes=false
spring.freemarker.expose-spring-macro-helpers=false
#spring.freemarker.prefix=
#spring.freemarker.request-context-attribute=
#spring.freemarker.settings.*=
spring.freemarker.suffix=.ftl
spring.freemarker.template-loader-path=classpath:/templates/
2、pom.xml引入依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
3、在resources目录下创建templates目录
4、freemarker常用标签
controller方法中传入ModeMap map; 相当于modeandview
springboot+freemarker的更多相关文章
- springboot + freemarker 实现国际化
前言 写过一篇springboot+freemarker国际化过程中的细节问题,但没有写过具体的国际化实现过程.正好有人在问,我就把我实现的过程贴出来,即使自己知识的一个备份,如果对别人有点用,那是再 ...
- springboot+freemarker毕业设计项目错误合集
1.springboot的主程序类必须在最外层. 换句话说,报错: This application has no explicit mapping for /error, so you are se ...
- idea+springboot+freemarker热部署(转)
今天在学习springboot集成freemarker模板引擎修改代码时,发现每次修改一次freemarker文件时,都必须重启下应用,浏览器刷新才能显示修改后的内容,这样效率太低,每次启动一次应用都 ...
- 用maven配置springboot+freemarker
1.创建项目 直接点下一步 原因: 不勾选 Create from archetype,是项目创建的骨架的时候,由于不知道什么原因就卡住了,一直在刷新 2.创建之后完成之后 添加依赖 <pa ...
- SpringBoot系统列 5 - 接口版本控制、SpringBoot FreeMarker模板引擎
接着上篇博客的代码继续写 1.接口版本控制 一个系统上线后会不断迭代更新,需求也会不断变化,有可能接口的参数也会发生变化,如果在原有的参数上直接修改,可能会影响线上系统的正常运行,这时我们就需要设置不 ...
- SpringBoot+FreeMarker开发word文档下载,预览
背景: 开发一个根据模版,自动填充用户数据并下载word文档的功能 使用freemarker进行定义模版,然后把数据进行填充. maven依赖: <parent> <groupId& ...
- springboot + freemarker 实现计算器
使用RequestParam("") 接受参数 其后参数有自动类型转换的作用 @RequestParam("firstNumber") double first ...
- Springboot + Freemarker(一)
Maven pom文件配置 <parent> <groupId>org.springframework.boot</groupId> <artifactId& ...
- idea 关闭自动保存,未保存星号提醒, springboot + freemarker 热部署
1,自动保存 File > setting 去掉下图勾选 2,未保存文件星号提示 File > Settings 3,spring boot 项目 热部署 3.1,pom文件添加依赖 &l ...
随机推荐
- BigInteger与BigDecimal
BigInteger与BigDecimal Java大数字运算(BigInteger类和BigDecimal类) 在 Java 中提供了用于大数字运算的类,即 java.math.BigInteger ...
- 中性SNP的突变年龄评估(estimate the average age of a neutral two-allele polymorphism)
假设中性突变的频率分别为P和1-P,则其突变年龄为:-4Ne[p*( logep)+(1-p)* loge (1-p)] The average age of a neutral two-allele ...
- linux系统调用之网络管理1
getdomainname 取域名 setdomainname 设置域名 gethostid 获取主机标识号 sethostid 设置主机标识号 gethostname 获取本主机名称 sethost ...
- JS事件(一)事件流&事件处理程序
1.事件流描述的是从页面接收事件的顺序 IE和Netscape提出了几乎完全相反的事件流概念 IE:事件冒泡(由内而外) Netscape:事件捕获(由外向内) DOM2级事件规定事件流包括三个阶段: ...
- (DFS)P1605 迷宫 洛谷
题目背景 迷宫 [问题描述] 给定一个N*M方格的迷宫,迷宫里有T处障碍,障碍处不可通过.给定起点坐标和 终点坐标,问: 每个方格最多经过1次,有多少种从起点坐标到终点坐标的方案.在迷宫 中移动有上下 ...
- Linux基础入门教程
Linux基础入门教程 --------- Linux学习路径 Linux学习者,常常不知道自己改怎么学习linux:Linux初级,也就是入门linux前提是需要有一些计算机硬件相关的知识或是有一下 ...
- webserver nginx / https / upstream
s nginx server_name 配置 https://segmentfault.com/q/1010000008426747?_ea=1647456 问题:我的host还没有域名,server ...
- [JUC-4]ThreadPoolExecutor源码分析
相关博文: https://segmentfault.com/a/1190000008693801 https://www.jianshu.com/p/fa1eac9710c8 //构造器1 publ ...
- Spring Boot 启动:No active profile set, falling back to default profiles: default
启动 Spring Boot 失败,但是没有出现多余的异常信息: 检查之后发现是依赖的问题(之前依赖的是 spring-boot-starter),修改即可: 方法二: pom.xml加上下面两个依赖 ...
- HDU 1026(迷宫 BFS+打印)
题意是要穿过一个迷宫并且将每一步打印出来. 用宽搜的方法找到路径,在 vis 中存一下方向,只是这题被看到的一种不太对的运算符重载坑了很久...... 代码如下: #include <bits/ ...