Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

charminseok

@Component, @ComponentScan 본문

Spring

@Component, @ComponentScan

charminseok 2021. 1. 22. 00:16

@Component 어노테이션을 사용해 빈 클래스에서 빈을 직접 등록할 수 있다.

 

ComponentScan의 주요사항 두가지 : 스캔 위치 설정, filter(어떤 어노테이션을 스캔할지 정하는 것)

 

컴포넌트에는 @Repository, @Service, @Controller이 있다.

@Component 어노테이션을 사용할 수도 있지만 좀더 적절한 상황에서 위의 3가지의 어노테이션을 사용하면 좋다.Core Technologies (spring.io) 1.10.1. @Component and Further Stereotype Annotations

'Spring' 카테고리의 다른 글

Environment(Property)  (0) 2021.01.22
Environment(프로파일)  (0) 2021.01.22
빈의 스코프  (0) 2021.01.22
@Autowired  (0) 2021.01.22
IoC 컨테이너  (0) 2021.01.21