thymeleaf引入css js寫法


以下是HTML引入方法,如果springboot使用thymeleaf模板,下面寫法無法正常引入資源文件,需改為thymeleaf引入方法
HTML引入方法:

<link href="/css/bootstrap.min.css" rel="stylesheet">
<script src="/js/jquery.js"></script>

thymeleaf引入方法:

<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet" type="text/css" />
<script type="text/javascript" th:src="@{/js/jquery.js}"></script>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM