Bean을 만들어 등록할때 같은 타입의 Bean이 없다면 사용 할 필요가 없지만
같은 타입의 Bean이 존재할 경우 이름으로 구분하기 위해 사용하는 어노테이션
@Service("testName")
public class testService {
@Autowired
public testSomething() {
super();
}
}
이런식으로 이름을 지정한 다음
@Autowired
public TestControllerImpl(@Qualifier("testName") testService test) {
super();
}
호출할때 이름으로 호출
'Spring' 카테고리의 다른 글
@Configuration, @PropertySource 어노테이션 (0) | 2024.03.13 |
---|---|
Model & ModelAttribute & RequestParam & PathVariable (0) | 2024.03.07 |
DTO, DAO, ConnectionPool, DataSource (0) | 2024.02.28 |
Spring Framework 기본개념 (0) | 2024.02.28 |