Thymeleaf 문법

2024. 3. 16. 03:37Java/Spring Framework

일반적인 css 참조 문법

<link href="./vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="./vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="./customized/project.css" rel="stylesheet">

 

타임리프에서 css 참조 문법

<link th:href="@{/vendors/bootstrap/dist/css/bootstrap.min.css}" rel="stylesheet">
<link th:href="@{/vendors/font-awesome/css/font-awesome.min.css}" rel="stylesheet">
<link th:href="@{/vendors/nprogress/nprogress.css}" rel="stylesheet">

 


일반적인 js 참조 문법

<script src="/vendors/jquery/dist/jquery.min.js"></script>
<script src="/vendors/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="/vendors/fastclick/lib/fastclick.js"></script>
<script src="/vendors/nprogress/nprogress.js"></script>

 

타임리프에서 js 참조 문법

<script th:src="@{/vendors/jquery/dist/jquery.min.js}"></script>
<script th:src="@{/vendors/bootstrap/dist/js/bootstrap.bundle.min.js}"></script>
<script th:src="@{/vendors/fastclick/lib/fastclick.js}"></script>
<script th:src="@{/vendors/nprogress/nprogress.js}"></script>

 

 

참고 문서 :

 

Standard URL Syntax - Thymeleaf

The Thymeleaf standard dialects –called Standard and SpringStandard– offer a way to easily create URLs in your web applications so that they include any required URL preparation artifacts. This is done by means of the so-called link expressions, a type

www.thymeleaf.org

 

'Java > Spring Framework' 카테고리의 다른 글

java.net.URLDecoder  (0) 2023.10.30
스프링 부트 2.4.1  (0) 2023.04.05
RedisTemplate - Spring 에서 \xaa 문자 안들어가게 하는 방법  (0) 2023.04.05