美文网首页
Springboot使用html作为view视图

Springboot使用html作为view视图

作者: 淡定丶说的是 | 来源:发表于2017-06-03 22:33 被阅读237次
  • 在pom.xml中增加thymeleaf依赖
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
  • 如果你的视图不是放在/templates/下面,需要在springboot文件中更改view的视图路径
spring:
  thymeleaf:
    prefix: classpath:/templates
    suffix: .html

相关文章

网友评论

      本文标题:Springboot使用html作为view视图

      本文链接:https://www.haomeiwen.com/subject/wnhufxtx.html