1. 程式人生 > >springboot-靜態資源預設訪問路徑順序

springboot-靜態資源預設訪問路徑順序

META-INF/resources/hello.html hello.html內容META-INF/resources/hello

static/hello.html hello.html內容static/hello

resources/hello.html 內容resources/hello

public/hello.html 內容public/hello

訪問http://localhost/hello.html

頁面內容META-INF/resources/hello,訪問路徑是META-INF/resources/hello.html,去掉該html

再訪問http://localhost/hello.html

內容:resources/hello,訪問路徑是resources/hello.html去掉該html

訪問http://localhost/hello.html

內容:static/hello,訪問路徑static/hello.html,去掉該html

再訪問http://localhost/hello.html

內容resources/public/hello world,訪問路徑public/hello world,去掉該html

由此實驗得知靜態資源預設訪問路徑是

META-INF/resources > resources > static > public