3
3
import org .springframework .context .support .AbstractApplicationContext ;
4
4
import org .springframework .context .support .ClassPathXmlApplicationContext ;
5
5
6
- /**This app is running fine!
6
+ /**
7
+ * This app is running fine!
7
8
* Remember to add apache.commson.logging and spring jars onto your classpath, otherwise the program won't run.
8
9
* It helps me understand how @Resource annotation works! Cool!
9
10
* Look at this project along with other two:
10
11
* SpringPureXMLDependencyInjectionExample
11
12
* Spring@RessourceAnnotationExample
12
- * to help me better understand the three possible ways to do DI using Spring.*/
13
+ * to help me better understand the three possible ways to do DI using Spring.
14
+ */
13
15
public class MainApp {
14
16
15
17
public static void main (String ... args ) {
16
18
System .out .println ("It started!" );
17
- AbstractApplicationContext context = new ClassPathXmlApplicationContext ("spring.xml" );
18
- Person p =(Person ) context .getBean ("person" );
19
+ AbstractApplicationContext context = new ClassPathXmlApplicationContext ("spring.xml" );
20
+ Person p = (Person ) context .getBean ("person" );
19
21
20
- System .out .println (p .getCity ().toString ());
21
- System .out .println (p .getWife ().toString ());
22
- System .out .println (p .getCareer ().toString ());
23
- }
22
+ System .out .println (p .getCity ().toString ());
23
+ System .out .println (p .getWife ().toString ());
24
+ System .out .println (p .getCareer ().toString ());
25
+ System .out .println ("It finished!" );
26
+ }
24
27
}
0 commit comments