예제 공부를 하다가, private boolean open; 과 private Boolean open; 이 나와서 chat GPT 를 통해 차이점을 찾아보았다. 관련된 개념적 내용은 다음과 같다. private boolean open; vs private Boolean open; Java에서 서로 다른 데이터 유형을 나타낸다. 1. private boolean open; 이것은 기본 데이터 유형인 boolean을 사용하는 변수를 선언한다. boolean은 두 가지 값 중 하나인 true 또는 false만을 가질 수 있는 원시 데이터 유형 따라서 open 변수는 true 또는 false 중 하나의 값을 가질 수 있다. 2. private Boolean open; 이것은 래퍼 클래스인 Boolean을 사용하..

입력 폼 처리 지금부터 타임리프가 제공하는 입력 폼 기능을 적용해서 기존 프로젝트의 폼 코드를 타임리프가 지원하는 기능을 사용해서 효율적으로 개선해 나간다. 먼저, 미리 핵심요약 1. 2. 등록 폼 th:object 를 적용하려면 먼저 해당 오브젝트 정보를 넘겨주어야 한다. 등록 폼이기 때문에 데이터가 비어있는 빈 오브젝트를 만들어서 뷰에 전달한다. FormItemController 변경 @GetMapping("/add") public String addForm(Model model) { model.addAttribute("item", new Item()); return "form/addForm"; } form/addForm.html 변경 부분 그림으로 먼저 설명 addForm.html(전체) 상품 등록..

파일 업로드 & 다운로드 예제 요구사항 1) 상품을 관리 상품 이름 첨부파일 하나 이미지 파일 여러개 2) 첨부파일을 업로드 다운로드 할 수 있다. 3) 업로드한 이미지를 웹 브라우저에서 확인할 수 있다. Item - 상품 도메인 package inflearn.upload.domain; import lombok.Data; import java.util.List; @Data // 예제이므로 @Data public class Item { private Long id; private String itemName; private UploadFile attachFile; private List imageFiles; } ItemRepository - 상품 리포지토리 package inflearn.upload.dom..
1> 스프링과 파일 업로드 https://github.com/euijooning/inflearn_File_Upload GitHub - euijooning/inflearn_File_Upload: 파일 업로드를 실습하기 위한 예제 파일입니다. 파일 업로드를 실습하기 위한 예제 파일입니다. Contribute to euijooning/inflearn_File_Upload development by creating an account on GitHub. github.com 2> 스프링 핵심 원리 관련 주제 > 📮주문과 할인 도메인 개발 📮Spring Container, Spring Bean 📮Singleton Container 📮Component Scan 📮Dependency Injection 📮Bean Lif..

재구조화 실시 클래스 Item.java @Data @NoArgsConstructor public class Item { private Long id; private String itemName; private Integer price; private Integer quantity; public Item(String itemName, Integer price, Integer quantity) { this.itemName = itemName; this.price = price; this.quantity = quantity; } } ItemRepository.java @Repository // 인터페이스가 아니므로 붙인 듯. 안에 @Component 있음 public class ItemRepository { ..
타임리프 스프링 통합 타임리프는 크게 2가지 메뉴얼을 제공한다. 기본 메뉴얼 : https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html Tutorial: Using Thymeleaf 1 Introducing Thymeleaf 1.1 What is Thymeleaf? Thymeleaf is a modern server-side Java template engine for both web and standalone environments, capable of processing HTML, XML, JavaScript, CSS and even plain text. The main goal of Thymeleaf is to provide a www.th..