전체 글 338

Spring_Autowire

Head에 등록하는 경우(byName) Heda에 등록하는 경우(byType) 겹치는 타입이 없어야 함 bean의 속성으로 등록하는 경우(byType) Bean + Primary(주입 대상 선택) Bean + Candidate=false(주입 대상 제외) @Autowired package com.spring; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Required; public class Person { private String userName; private int age; @Autowired Cat cat; @Autowired priv..