[英]Spring boot resource static folder
您的網址沒有斜杠。
http://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#link-urls
URL有不同類型:
- 絕對網址: http : //www.thymeleaf.org
- 相對URL,可以是:
- 相對頁面:user / login.html
- 上下文相關:/ itemdetails?id = 3(服務器中的上下文名稱將自動添加)
- 相對於服務器:〜/ billing / processInvoice(允許在同一服務器中的另一個上下文(=應用程序)中調用URL。
- 相對於協議的網址://code.jquery.com/jquery-2.0.3.min.js
屏幕快照中的URL bootstrap / css / bootstrap.min.css是相對於頁面的。
您需要的是上下文相關的URL。 當文件位於src / main / resources / static / css / bootstrap.min.css中時 ,請使用:
th:href="@{/css/bootstrap.min.css}"
當它在src / main / resources / static / bootstrap / bootstrap.min.css中時 ,請使用:
th:href="@{/bootstrap/bootstrap.min.css}"
此外,建議您不要使用Bootstrap WebJar ,然后使用以下href,而不是手動下載bootstrap.min.css:
th:href="@{/webjars/bootstrap/3.3.6/css/bootstrap.min.css}"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.