-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathspring_component_scan_example.xml
24 lines (20 loc) · 1.11 KB
/
spring_component_scan_example.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0" encoding="UTF-8"?>
<!--suppress SpringFacetInspection -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- All magic hides within this line:
It does a component scan for this package, so any beans that have any one of the following three annotations:
@Repository, @Service or @Component
will be scanned and autowired up.
Also I'll have to put @Autowired annotation on those private fields inside that Person clalss. -->
<context:component-scan base-package="spring_component_scan_example"/>
<bean id="wife" class="spring_component_scan_example.Wife">
<property name="name" value="Sophie Sun"/>
<property name="faith" value="Christian"/>
</bean>
</beans>