Sringboot-3-web(未完)
时间:2021-09-06 04:46:40
收藏:0
阅读:18
静态资源
源码


静态资源的处理方式
webjars localhost:8080/webjars/
public,static,/**,resources localhost:8080/
优先级
resources>static(默认)>public
首页相关
源码

将index.html放在静态资源路径下


模板引擎thymeleaf
导包
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring5</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-java8time</artifactId>
</dependency>
编写html,放在templates包下

编写controller调用
调用成功
原文:https://www.cnblogs.com/keacua/p/15227378.html
评论(0)