The <context:component-scan> element
does everything that <context:annotation-config> does, plus it configures
Spring to automatically discover beans and declare them for you. What this means is
that most (or all) of the beans in your Spring application can be declared and wired
without using <bean>.
Spring's very own annotation:
The @Inject annotation from JSR-000330 Dependency Injection for Java
The @Resource annotation from JSR-000250 Common Annotations for the Java(tm) Platform ("Specification") : The Resource annotation is used to declare a reference to a resource. It can be specified on a class, methods or on fields. When the annotation is applied on a field or method, the container will inject an instance of the requested resource into the application when the application is initialized. If the annotation is applied to a class, the annotation declares a resource that the application will look up at runtime.
- Usage of @Autowired
- Usage of @Qualifier
- Usage of @Value
- Usage of @Inject
- QUALIFYING @INJECTED PROPERTIES