@Component 元注解 这是一个元注解,意思是它可以用于标注其他注解,被它标注的注解和它起到相同或者类似的作用.Spring用它定义了其他具有特定意义的注解如@Controller @Service @Repository.如下是Spring中 @Service的定义: @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @Documented @Component // Spring will see this…
Component Scan is important concept when we want to create Bean. Currently we know what, for the class, we want to create Bean from it, we need to add @Component. @Component @Scope(ConfigurableBeanFactory.SCOPE_SINGLETON) public class ComponentPerson…
<context:component-scan base-package="com.matt.cloud"/> bean-context中 spring.handlers文件 http\://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler public class ContextNamespaceHandler extends…