<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h1>URL 링크</h1>
<ul>
<!--절대경로 = http://localhost:8080/hello-->
<li><a th:href="@{/hello}">basic url</a></li>
<!--상대경로= http://localhost:8080/basic/hello-->
<li><a th:href="@{hello}">basic url</a></li>
<!--http://localhost:8080/hello?param1=data1¶m2=data2-->
<li><a th:href="@{/hello(param1=${param1}, param2=${param2})}">hello queryparam</a></li>
<!--http://localhost:8080/hello/data1/data2-->
<li><a th:href="@{/hello/{param1}/{param2}(param1=${param1}, param2=${param2})}">path variable</a></li>
<!--http://localhost:8080/hello/data1?param2=data2-->
<li><a th:href="@{/hello/{param1}(param1=${param1}, param2=${param2})}">path variable + query parameter</a></li>
</ul>
</body>
</html>
'thymeleaf' 카테고리의 다른 글
타임리프 div 여러개 묶어서 반복 (0) | 2022.06.27 |
---|---|
타임리프 조건문 (0) | 2022.06.27 |
타임리프 반복문 (0) | 2022.06.27 |
타임리프 데이터 없을 때 (0) | 2022.06.27 |
타임리프 리터럴 대체 (0) | 2022.06.27 |