1.static 下面的静态文件访问方式
位于static下的静态文件可以直接访问
static/img/xx.png
static/js/xx.js
访问方式: localhost:8080/img/xx.png localhost:8080/js/xx.js
2.其他静态目录
resources目录中除了static这个静态文件外,还有 resources和 public这2个目录, 三者优先级
resources > static > public
3.templates中的文件不能直接访问,需要配置
***在pom文件引入依赖
前提条件:在templates放入一个index.html模板文件
***index.html
<!DOCTYPE html>
<html lang="en">