File tree 9 files changed +134
-4
lines changed
src/main/java/com/springcore1/refenceInjection
META-INF/maven/com.springcore/springcore
com/springcore1/refenceInjection
9 files changed +134
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ public class App {
7
7
public static void main (String [] args ) {
8
8
9
9
10
- ApplicationContext context = new ClassPathXmlApplicationContext ("com/springcore1/refenceInjection/refconfig .xml" );
10
+ ApplicationContext context = new ClassPathXmlApplicationContext ("com/springcore1/refenceInjection/refconfigUsingRefAttribute .xml" );
11
11
A objA =(A )context .getBean ("aref" );
12
12
System .out .println (objA );
13
13
System .out .println ("------------------------" );
Original file line number Diff line number Diff line change 23
23
</bean> -->
24
24
<bean class =" com.springcore1.refenceInjection.A" name =" aref" >
25
25
<property name =" x" value =" 111" />
26
- <property name =" objB" > <ref bean =" bref" />
26
+ <property name =" objB" >
27
+ <ref bean =" bref" />
27
28
</property >
28
29
</bean >
29
30
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <beans xmlns =" http://www.springframework.org/schema/beans"
3
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
+ xmlns : context =" http://www.springframework.org/schema/context"
5
+ xmlns : p =" http://www.springframework.org/schema/p"
6
+ xsi : schemaLocation =" http://www.springframework.org/schema/beans
7
+ http://www.springframework.org/schema/beans/spring-beans.xsd
8
+ http://www.springframework.org/schema/context
9
+ http://www.springframework.org/schema/context/spring-context.xsd" >
10
+
11
+
12
+
13
+ <bean class =" com.springcore1.refenceInjection.B" name =" bref" p : y =" 000" >
14
+
15
+ </bean >
16
+
17
+
18
+ <!-- <bean class="com.springcore1.refenceInjection.A" name="aref">
19
+ <property name="x" value="111" />
20
+ <property name="ob">
21
+ <ref bean="bref"/>
22
+ </property>
23
+ </bean> -->
24
+ <bean class =" com.springcore1.refenceInjection.A" name =" aref" p : x =" 559" p : objB-ref =" bref" >
25
+
26
+ </bean >
27
+
28
+
29
+
30
+
31
+ </beans >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <beans xmlns =" http://www.springframework.org/schema/beans"
3
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
+ xmlns : context =" http://www.springframework.org/schema/context"
5
+ xmlns : p =" http://www.springframework.org/schema/p"
6
+ xsi : schemaLocation =" http://www.springframework.org/schema/beans
7
+ http://www.springframework.org/schema/beans/spring-beans.xsd
8
+ http://www.springframework.org/schema/context
9
+ http://www.springframework.org/schema/context/spring-context.xsd" >
10
+
11
+
12
+
13
+ <bean class =" com.springcore1.refenceInjection.B" name =" bref" >
14
+ <property name =" y" value =" 2222" />
15
+ </bean >
16
+
17
+
18
+ <!-- <bean class="com.springcore1.refenceInjection.A" name="aref">
19
+ <property name="x" value="111" />
20
+ <property name="ob">
21
+ <ref bean="bref"/>
22
+ </property>
23
+ </bean> -->
24
+ <bean class =" com.springcore1.refenceInjection.A" name =" aref" >
25
+ <property name =" x" value =" 111" />
26
+ <property name =" objB" ref =" bref" />
27
+
28
+ </bean >
29
+
30
+
31
+
32
+
33
+ </beans >
Original file line number Diff line number Diff line change 1
1
# Generated by Maven Integration for Eclipse
2
- # Mon Aug 12 03:13:41 IST 2024
2
+ # Mon Aug 12 04: 03:11 IST 2024
3
3
artifactId =springcore
4
4
groupId =com.springcore
5
5
m2e.projectLocation =/Volumes/project/LearningSpring/springcore1
Original file line number Diff line number Diff line change 23
23
</bean> -->
24
24
<bean class =" com.springcore1.refenceInjection.A" name =" aref" >
25
25
<property name =" x" value =" 111" />
26
- <property name =" objB" > <ref bean =" bref" />
26
+ <property name =" objB" >
27
+ <ref bean =" bref" />
27
28
</property >
28
29
</bean >
29
30
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <beans xmlns =" http://www.springframework.org/schema/beans"
3
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
+ xmlns : context =" http://www.springframework.org/schema/context"
5
+ xmlns : p =" http://www.springframework.org/schema/p"
6
+ xsi : schemaLocation =" http://www.springframework.org/schema/beans
7
+ http://www.springframework.org/schema/beans/spring-beans.xsd
8
+ http://www.springframework.org/schema/context
9
+ http://www.springframework.org/schema/context/spring-context.xsd" >
10
+
11
+
12
+
13
+ <bean class =" com.springcore1.refenceInjection.B" name =" bref" p : y =" 000" >
14
+
15
+ </bean >
16
+
17
+
18
+ <!-- <bean class="com.springcore1.refenceInjection.A" name="aref">
19
+ <property name="x" value="111" />
20
+ <property name="ob">
21
+ <ref bean="bref"/>
22
+ </property>
23
+ </bean> -->
24
+ <bean class =" com.springcore1.refenceInjection.A" name =" aref" p : x =" 559" p : objB-ref =" bref" >
25
+
26
+ </bean >
27
+
28
+
29
+
30
+
31
+ </beans >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <beans xmlns =" http://www.springframework.org/schema/beans"
3
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
+ xmlns : context =" http://www.springframework.org/schema/context"
5
+ xmlns : p =" http://www.springframework.org/schema/p"
6
+ xsi : schemaLocation =" http://www.springframework.org/schema/beans
7
+ http://www.springframework.org/schema/beans/spring-beans.xsd
8
+ http://www.springframework.org/schema/context
9
+ http://www.springframework.org/schema/context/spring-context.xsd" >
10
+
11
+
12
+
13
+ <bean class =" com.springcore1.refenceInjection.B" name =" bref" >
14
+ <property name =" y" value =" 2222" />
15
+ </bean >
16
+
17
+
18
+ <!-- <bean class="com.springcore1.refenceInjection.A" name="aref">
19
+ <property name="x" value="111" />
20
+ <property name="ob">
21
+ <ref bean="bref"/>
22
+ </property>
23
+ </bean> -->
24
+ <bean class =" com.springcore1.refenceInjection.A" name =" aref" >
25
+ <property name =" x" value =" 111" />
26
+ <property name =" objB" ref =" bref" />
27
+
28
+ </bean >
29
+
30
+
31
+
32
+
33
+ </beans >
You can’t perform that action at this time.
0 commit comments