@Component annotates the top-level annotation and its extended annotations

@Component is a meta-annotation, which means that other class annotations can be annotated, such as @Controller @Service @Repository @Aspect. The official words are: Classes with this annotation are regarded as components, and these classes will be instantiated when using annotation-based configuration and classpath scanning. Other class-level annotations can also be identified as a special type of component, such as @Repository @Aspect. Therefore, @Component can annotate other class annotations.

 

Guess you like

Origin blog.csdn.net/listeningdu/article/details/128587892