diff --git a/src/main/java/com/msb/springIOC/Driver.java b/src/main/java/com/msb/springIOC/Driver.java new file mode 100644 index 0000000..c7acdeb --- /dev/null +++ b/src/main/java/com/msb/springIOC/Driver.java @@ -0,0 +1,19 @@ +package com.msb.springIOC;/** + * @Author bingor + * @Date 2022/10/10 11:00 + * @Description: com.msb.springAOC + * @Version: 1.0 + */ + +/** + *@ClassName Driver + *@Description TODO + *@Author bingor + *@Date 2022/10/10 11:00 + *@Version 3.0 + */ +public class Driver { + public Driver() { + System.out.println("new Driver"); + } +} diff --git a/src/main/java/com/msb/springIOC/Main.java b/src/main/java/com/msb/springIOC/Main.java new file mode 100644 index 0000000..a5d83df --- /dev/null +++ b/src/main/java/com/msb/springIOC/Main.java @@ -0,0 +1,23 @@ +package com.msb.springIOC;/** + * @Author bingor + * @Date 2022/10/10 11:00 + * @Description: com.msb.springAOC + * @Version: 1.0 + */ + +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +/** + *@ClassName Main + *@Description TODO + *@Author bingor + *@Date 2022/10/10 11:00 + *@Version 3.0 + */ +public class Main { + public static void main(String[] args) { + ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml"); +// Driver driver = (Driver) context.getBean("driver"); + } +} diff --git a/src/main/resources/applicationContext.xml b/src/main/resources/applicationContext.xml new file mode 100644 index 0000000..f94c065 --- /dev/null +++ b/src/main/resources/applicationContext.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file