There was an error while loading. Please reload this page.
1 parent 81a6306 commit ac7a117Copy full SHA for ac7a117
src/com/luv2code/springdemo/AnnotationDemoApp.java
@@ -0,0 +1,21 @@
1
+package com.luv2code.springdemo;
2
+
3
+import org.springframework.context.support.ClassPathXmlApplicationContext;
4
5
+public class AnnotationDemoApp {
6
7
+ public static void main(String[] args) {
8
9
+// Read the spring config file
10
+ ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
11
12
+// Retrieve the bean from Spring container
13
+ Coach coach = context.getBean("thatSillyCoach", Coach.class);
14
15
+// Call methods on the bean
16
+ System.out.println(coach.getDailyWorkout());
17
18
+// Close the context
19
+ context.close();
20
+ }
21
+}
0 commit comments