Thymeleaf에서 Enum 사용

Thymeleaf

Overview Thymeleaf에서 TAG SELECT 내 데이터를 사용할때 하드코딩으로 하는 방법도 있지만, 아래 두가지 방법으로 Java Enum Type을 사용할 수 있다. th:each를 사용 <select class="form-select" id="dtl-productCd" name="productCd" th:field="${detail.ProductCd}"> <option th:each="enumValue: ${T(com.example.common.ProductCd).values()}" th:value="${enumValue}" th:text="${enumValue.label()}" /> </select> ${T(com.example.common.ProductCd.values())} 를 th:each로 지정 후 value, text를 위 형태로 사용한다. [Read More]
Tags: HTML Thymeleaf

H2 Database install

H2

Overview JAVA SQL Database로 in-memory DB이다. 경량 DB로 Local 환경에서 테스트에 용의하게 사용되곤 한다. 아래와 같은 특징을 가진다. Features [Read More]
Tags: H2 Database