메모장

thymeleaf 컨버전 적용

키스샷1104 2023. 10. 26. 10:32
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<ul>
    <li>${number}: <span th:text="${number}" ></span></li>
    <li>${{number}}: <span th:text="${{number}}" ></span></li>
    <li>${ipPort}: <span th:text="${ipPort}" ></span></li>
    <li>${{ipPort}}: <span th:text="${{ipPort}}" ></span></li>
</ul>
</body>
</html>

괄호가 {{}} 이렇게 두개가 되어있으면 컨버전이 적용이 된다..

 

th:field를 적용해도 컨버전이 적용된다.