1.以前靜態資源是放在webapp中,然後打jar包,靜態資源始終打不進jar包
2.後來把靜態頁面放在了resources下面的templates裏面,css、img、js放在了resources下面的static下面
3.application.properties裏面添加下面這句代碼
spring.resources.static-locations=classpath:/templates/,classpath:/static/
4.訪問:瀏覽器就可以直接訪問了
5.打jar包:然後靜態頁面這些就打入進來了