I\'m learning Spring 3 and I don\'t seem to grasp the functionality behind
and
.
:
This is used to tell the container that there are bean classes in my package scan those bean classes. In order to scan bean classes by container on top of the bean we have to write one of the stereo type annotation like following.
@Component
, @Service
, @Repository
, @Controller
:
If we don't want to write bean tag explicitly in XML then how the container knows if there is a auto wiring in the bean. This is possible by using @Autowired
annotation. we have to inform to the container that there is auto wiring in my bean by context:annotation-config
.