Spring boot使用thymeleaf模板
来源:互联网 发布:淘宝秒杀群号 编辑:程序博客网 时间:2024/06/07 01:39
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
如何关闭thymeleaf缓存?
########################################################
###THYMELEAF (ThymeleafAutoConfiguration)
########################################################
#spring.thymeleaf.prefix=classpath:/templates/
#spring.thymeleaf.suffix=.html
#spring.thymeleaf.mode=HTML5
#spring.thymeleaf.encoding=UTF-8
# ;charset=<encoding> is added
#spring.thymeleaf.content-type=text/html
# set to false for hot refresh
spring.thymeleaf.cache=false
编写模板文件.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
<title>Hello World!</title>
</head>
<body>
<h1 th:inline="text">Hello.v.2</h1>
<p th:text="${hello}"></p>
</body>
</html>
编写访问模板文件controller?
@Controller
public class TemplateController {
/**
* 返回html模板.
*/
@RequestMapping("/helloHtml")
public String helloHtml(Map<String,Object> map){
map.put("hello","from TemplateController.helloHtml");
return "/helloHtml";
}
}
- spring-boot--使用thymeleaf模板
- spring-boot--使用thymeleaf模板
- Spring Boot使用thymeleaf模板
- spring-boot--使用thymeleaf模板
- spring-boot--使用thymeleaf模板
- spring boot使用thymeleaf模板
- spring-boot--使用thymeleaf模板
- Spring Boot 使用 Thymeleaf模板
- spring-boot--使用thymeleaf模板
- Spring boot使用thymeleaf模板
- Spring-boot中thymeleaf模板使用小结
- (8)spring boot使用thymeleaf模板引擎
- 9. Spring Boot使用thymeleaf模板
- Spring Boot使用Thymeleaf
- spring-boot--整合thymeleaf模板
- spring-boot thymeleaf模板学习
- spring-boot--整合thymeleaf模板
- Spring Boot–thymeleaf模板
- 纹理映射
- web.xml中的url-pattern 写法小结(附源码分析)
- QFile转换为QPixmap
- Android底部导航栏的四种实现
- jquery判断checkbox是否选中,选中即可点击button否则不可点
- Spring boot使用thymeleaf模板
- JAVA知识_5
- Mycat学习实战-Mycat全局主键
- JavaSE06继承和多态
- Android ViewPagerIndicator仿今日头条标题栏效果(一)
- 学术画像技术
- ios动画之贝塞尔曲线和PaintCode
- 编程能力七段论(上)
- S5PV210开发 -- 烧写/启动模式