조건문2 Thymeleaf 기본 Thymeleaf 선언html 문서에 해당 문구를 적어야, thymeleaf 템플릿을 사용해야하는 것을 인지할 수 있다 Text 출력Model Attribute 값 출력${data}html 이스케이프 회피th:utext Object 출력th:text="${user.username}"th:text="${user['username']}"th:text="${user.getUsername()}" List 출력th:text="${users[0].username}"th:text="${users[0]['username']}"th:text="${users[0].getUsername()}" Map 출력th:text="${userMap['userA'].username}"th:text="${userMap['userA']['.. 2024. 9. 23. 조건문과 반복문 조건문, 반복문 조건문에 들어갈 수 있는 형식1. bool2. 비교연산3. 논리연산4. 함수호출5. 문자열 비교6. 포인터 검사7. 컴마(,)연산자8. 삼항연산자조건문조건문에 들어갈 수 있는 형식boolif (true) {} 비교연산if ( a > b ) {}논리연산if ( a ==1 && b ==2 ) {}함수호출if (TEST()) {} // bool TEST{ return true; } 문자열비교if ("compare" == "fail" ) {} 포인터검사if(ptr) { // ptr이 null이 아닐때 } // if (!ptr) {// ptr이 null 일때} 컴마(,)연산자if ( (a= b+1), a>20 ) {} // b+1이 a에 대입되고, a가 20보다 크면 수행삼항연산자if ( (a .. 2024. 6. 21. 이전 1 다음