본문 바로가기
#6-3 / thymeleaf - 2차배열 출력 👀 알아두쇼==>  일반text + 변수 표현시  |  안에 집어넣으면 됨!    (  3.x 사용 가능  )    👀 2차 원시배열, class배열   - Controller@GetMapping("/arrays.do")public String arrays(Model m) { String arr[][] = { {"홍길동","강감찬","이순신"}, {"22","33","44"} }; m.addAttribute("arr",arr); ArrayList> all = new ArrayList>(); ArrayList al = new ArrayList(); al.add("서울지사"); al.add("경기도지사"); al.add("강원도지사");.. 2024. 8. 21.
#6-2 / thymeleaf - 협업시 properties 분리 src/main/resources - newfile  - thymeleaf.properties 파일 생성함기존 application.properties 여기에 있던 thymeleaf 부분  thymeleaf.properties 여기에 복붙  후기존 application.properties 여기에#메인 properties 외에 별도의 properties를 가져와야할 경우spring.config.import=thymeleaf.properties추가 => 잘 작동됨ㅋ 2024. 8. 21.
#6-1 / Thymeleaf 외부파일 로드 , layout thymeleaf 외부 파일로드 규칙 templates , webapp 에 있는 파일은 서로 include 불가resource 안에서 모든 것을 핸들링 해야함 🤷‍♂️❓th:fragment영역 처리를 담당하는 thymeleaf 속성th:fragment = "가상의 이름"th:fragment="main(data)" 요렇게 인자값을 넘길 수도 있음 th:replace영역(fragment)을 가져오는 thymeleaf 속성th:replace="~{경로 :: fragment이름}"  th:insertthymelefa 3.x 속성 (== replace)replace는 곧 없어질듯~ ==>  replace는 기존 태그를 삭제 후 로드하는 방식 / insert는 기존태그 삭제 없이 로드하는 방식        ins.. 2024. 8. 21.
#5-2 / thymeleaf로 데이터 출력 2 👀 JSP + thymeleaf  - controller@GetMapping("/datalist2.do")public String datalist2(Model m) { m.addAttribute("view","JSP & JSTL"); return "datalist2"; // 걍 null로 해도 되는듯}   - datalist2.jsp/* */이걸 지워줘야함 ✅ view 파일 속성명을html과 jsp 함께 사용시 상위 속성을 입력해야함! application.properties여기에 spring.thymeleaf.cache=falsespring.thymeleaf.check-template-location=truespring.thymeleaf.enabled=truespring.thymeleaf... 2024. 8. 20.