<bean id="u1" class="com.*.dao.impl.UserDAOImpl">
<!--collaborators and configuration for this bean go here -->
</bean>
<bean id="userService" class="com.*.service.UserService">
</bean>
等价于:
<context:annotation-config/>
<context:component-scan base-package="*.*"></context:component-scan>
@Component("name")
@Resource(name=" name ")name为key
@Component("name ")