thymeleaf
Thymeleaf ์๋ฒ์์ view๋ฅผ ๊ตฌ์ฑํ ๋ ์ฌ์ฉํ๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ํ๊ทธ ํ์์ ๋ฌธ๋ฒ์ ์ฌ์ฉํ๋ฉฐ vue์ ์ ์ฌํ๋ค. ๊ธฐ๋ณธ ๋ฌธ๋ฒ thymeleaf ๊ณต์ ํํ ๋ฆฌ์ผ ์์ ๊ธฐ๋ณธ์ ์ธ ๋ฌธ๋ฒ์ ํ์ธํ ์ ์๋ค. ํ๊ทธ ์์ th:์์ฑ="๊ฐ" ํํ์ ์์ฑ์ ์ถ๊ฐํ๋ ํํ๋ก ์ฌ์ฉํ๋ค. text <span th:text="${text}">default text</span>: ์๋ฒ์์ โtextโ๋ผ๋ ์ด๋ฆ์ผ๋ก ์ ์ํ ํ๊ทธ๊ฐ ์์ผ๋ฉด text๋ฅผ ํ์ํ๋ค. text๋ณ์๊ฐ ์์ผ๋ฉด <span>default text</span>๋ฅผ ํ์ํ๋ค. utext <span th:utext="${utext}">default text</span>: โtextโ ์ด๋ฆ์ผ๋ก ์ ์ํ ํ ์คํธ๋ฅผ โspanโ ํ๊ทธ์ ๋ฃ์ด ํ์ํ๋ค. โtextโ๋ณ์๊ฐ ์์ผ๋ฉด โdefault textโ๋ฅผ ํ์ํ๋ค. fragment <div th:fragment="name">: โnameโ ์ด๋ผ๋ ์ด๋ฆ์ผ๋ก fragment๋ฅผ ์์ฑํ๋ค. fragment๋ th:replace, th:copy ๋ฅผ ์ฌ์ฉํด์ ์ฌํ์ฉ ๊ฐ๋ฅํ๋ค. copy <div th:copy="this::name">: ํ์ฌ ํ์ผ์ โnameโ fragment๋ฅผ โdivโํ๊ทธ๋ก ํํํ๋ค. โthisโ ๋์ ํ์ผ ์ด๋ฆ์ ์ฌ์ฉํ๋ฉด ๋ค๋ฅธ ํ์ผ์ fragment๋ฅผ ์ฌ์ฉ ๊ฐ๋ฅํ๋ค. replace <div th:replace="this::name">: ํ์ฌ ํ์ผ์ โnameโ fragment๋ก ๋์ฒดํ๋ค.(ํ๊ทธ๋ ๋ฐ๋๋ค.) โthisโ ๋์ ํ์ผ ์ด๋ฆ์ ์ฌ์ฉํ๋ฉด ๋ค๋ฅธ ํ์ผ์ fragment๋ฅผ ์ฌ์ฉ๊ฐ๋ฅํ๋ค.