1. 程式人生 > >springboot頁面資源,靜態資源讀取

springboot頁面資源,靜態資源讀取

springboot頁面資源 預設是從templates目錄下讀取

application.properties中

## 響應頁面預設字尾
spring.mvc.view.suffix=.html
spring.mvc.view.prefix=/templates/

springboot靜態資源 預設是從 static目錄下讀取的


故這裡引入靜態資源這麼寫即可,直接寫static/下的路徑

<head>
    <title>Hello World!</title>
    <script type="text/javascript" src="/jquery-1.8.3.min.js"></script>
</head>