您的位置:首页 > 编程语言 > Java开发

thymeleaf :springboot整合mybatis的web项目中使用html而不是jsp当页面渲染

2017-10-26 00:00 1231 查看
1.引入依赖

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

2.application.properties中添加

classpath:/templates/*.html
classpath:/static/
#thymeleaf start
spring.thymeleaf.mode=HTML5
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.content-type=text/html
#开发时关闭缓存,不然没法看到实时页面
spring.thymeleaf.cache=false
#thymeleaf end

3.OK
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: