4. SpringBoot 입문 - Spring Bean과 의존관계(2) - Java 코드로 직접 Spring Bean 등록하기
Java 코드로 직접 Spring Bean 등록하기 이전 글에서는 컴포넌트(@Service, @Controller, @Repository)를 이용하여 Spring Bean을 등록하는 방법을 알아보았습니다. 이번 글에서는 Java 코드로 Spring에 직접 등록하는 방법에 대해 알아보겠습니다. 루트 디렉토리에 SpringConfig 클래스 파일을 생성해줍니다. package hello.hellospring; import hello.hellospring.repository.*; import hello.hellospring.service.MemberService; import org.springframework.context.annotation.Bean; import org.springframework.con..
2021.05.24