From 6542b9ce7ef1bf918a21a756def0941afcddd33c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B5=B5=E6=9D=B0?= <2817274709@qq.com> Date: Sun, 18 Dec 2022 17:47:38 +0800 Subject: [PATCH] feature: homework --- ...-\345\210\230\350\265\265\346\235\260.sql" | 28 ++++++ .../IOC/.idea/.gitignore" | 8 ++ .../IOC/.idea/.name" | 1 + .../IOC/.idea/compiler.xml" | 13 +++ .../inspectionProfiles/Project_Default.xml" | 36 +++++++ .../IOC/.idea/jarRepositories.xml" | 20 ++++ .../IOC/.idea/misc.xml" | 14 +++ .../IOC/.idea/runConfigurations.xml" | 10 ++ .../IOC/pom.xml" | 29 ++++++ .../src/main/java/com/xju/edu/bean/Cat.java" | 7 ++ .../src/main/java/com/xju/edu/bean/Dog.java" | 7 ++ .../main/java/com/xju/edu/bean/UserBean.java" | 24 +++++ .../main/java/com/xju/edu/test/TestIOC.java" | 26 +++++ .../main/resources/applicationContext.xml" | 21 ++++ .../target/classes/applicationContext.xml" | 21 ++++ .../target/classes/com/xj/edu/bean/Cat.class" | Bin 0 -> 491 bytes .../target/classes/com/xj/edu/bean/Dog.class" | Bin 0 -> 491 bytes .../classes/com/xj/edu/bean/UserBean.class" | Bin 0 -> 813 bytes .../classes/com/xj/edu/test/TestIOC.class" | Bin 0 -> 1168 bytes .../DI/.idea/.gitignore" | 8 ++ .../DI/.idea/compiler.xml" | 14 +++ .../DI/.idea/encodings.xml" | 7 ++ .../inspectionProfiles/Project_Default.xml" | 36 +++++++ .../DI/.idea/jarRepositories.xml" | 25 +++++ .../DI/.idea/misc.xml" | 17 ++++ .../DI/.idea/runConfigurations.xml" | 10 ++ .../DI/pom.xml" | 82 ++++++++++++++++ .../DI/src/main/java/com/xju/edu/Demo.java" | 90 ++++++++++++++++++ .../src/main/java/com/xju/edu/TestDemo.java" | 18 ++++ .../main/resources/applicationContext.xml" | 43 +++++++++ .../DI/src/main/resources/demo.properties" | 2 + .../DI/src/main/webapp/WEB-INF/web.xml" | 7 ++ .../DI/src/main/webapp/index.jsp" | 5 + .../DI/target/classes/applicationContext.xml" | 43 +++++++++ .../DI/target/classes/com/xju/edu/Demo.class" | Bin 0 -> 3103 bytes .../classes/com/xju/edu/TestDemo.class" | Bin 0 -> 1023 bytes .../DI/target/classes/demo.properties" | 2 + 37 files changed, 674 insertions(+) create mode 100644 "1\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/1\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260.sql" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/.gitignore" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/.name" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/compiler.xml" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/inspectionProfiles/Project_Default.xml" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/jarRepositories.xml" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/misc.xml" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/runConfigurations.xml" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/pom.xml" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/java/com/xju/edu/bean/Cat.java" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/java/com/xju/edu/bean/Dog.java" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/java/com/xju/edu/bean/UserBean.java" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/java/com/xju/edu/test/TestIOC.java" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/resources/applicationContext.xml" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/target/classes/applicationContext.xml" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/target/classes/com/xj/edu/bean/Cat.class" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/target/classes/com/xj/edu/bean/Dog.class" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/target/classes/com/xj/edu/bean/UserBean.class" create mode 100644 "2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/target/classes/com/xj/edu/test/TestIOC.class" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/.gitignore" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/compiler.xml" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/encodings.xml" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/inspectionProfiles/Project_Default.xml" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/jarRepositories.xml" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/misc.xml" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/runConfigurations.xml" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/pom.xml" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/java/com/xju/edu/Demo.java" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/java/com/xju/edu/TestDemo.java" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/resources/applicationContext.xml" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/resources/demo.properties" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/webapp/WEB-INF/web.xml" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/webapp/index.jsp" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/target/classes/applicationContext.xml" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/target/classes/com/xju/edu/Demo.class" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/target/classes/com/xju/edu/TestDemo.class" create mode 100644 "3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/target/classes/demo.properties" diff --git "a/1\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/1\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260.sql" "b/1\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/1\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260.sql" new file mode 100644 index 0000000..d1c18e7 --- /dev/null +++ "b/1\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/1\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260.sql" @@ -0,0 +1,28 @@ +# 创建表先丢弃原表 +DROP TABLE IF EXISTS `权限表`; + +# 创建表结构 +CREATE TABLE `权限表` ( + `ID` int NOT NULL AUTO_INCREMENT, + `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL, + `phone` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL, + `sex` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL, + `date` datetime NULL DEFAULT NULL, + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic; + +# 添加5行数据 其中一行数据只添加性别 +INSERT INTO `权限表` VALUES (1, NULL, NULL, '男', NULL); +INSERT INTO `权限表` VALUES (2, '刘赵杰', NULL, NULL, NULL); +INSERT INTO `权限表` VALUES (3, NULL, '123', NULL, NULL); +INSERT INTO `权限表` VALUES (4, NULL, NULL, NULL, '2022-11-26 13:12:18'); +INSERT INTO `权限表` VALUES (5, '刘赵杰', '123', '男', '2022-11-20 13:12:39'); + +SET FOREIGN_KEY_CHECKS = 1; + +# 修改两条数据 第一次修改名字 第二次修改性别 +UPDATE `权限表` set `name` = '测试' WHERE id = 2; +UPDATE `权限表` set sex = '女' WHERE id = 1; + +# 按照电话号删除一条数据 +DELETE FROM `权限表` WHERE phone = 123; \ No newline at end of file diff --git "a/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/.gitignore" "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/.gitignore" new file mode 100644 index 0000000..13566b8 --- /dev/null +++ "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/.gitignore" @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git "a/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/.name" "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/.name" new file mode 100644 index 0000000..b38808a --- /dev/null +++ "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/.name" @@ -0,0 +1 @@ +IOC \ No newline at end of file diff --git "a/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/compiler.xml" "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/compiler.xml" new file mode 100644 index 0000000..b0d2909 --- /dev/null +++ "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/compiler.xml" @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git "a/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/inspectionProfiles/Project_Default.xml" "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/inspectionProfiles/Project_Default.xml" new file mode 100644 index 0000000..6560a98 --- /dev/null +++ "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/inspectionProfiles/Project_Default.xml" @@ -0,0 +1,36 @@ + + + + \ No newline at end of file diff --git "a/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/jarRepositories.xml" "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/jarRepositories.xml" new file mode 100644 index 0000000..980588c --- /dev/null +++ "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/jarRepositories.xml" @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git "a/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/misc.xml" "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/misc.xml" new file mode 100644 index 0000000..fe1451c --- /dev/null +++ "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/misc.xml" @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git "a/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/runConfigurations.xml" "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/runConfigurations.xml" new file mode 100644 index 0000000..797acea --- /dev/null +++ "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/.idea/runConfigurations.xml" @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git "a/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/pom.xml" "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/pom.xml" new file mode 100644 index 0000000..46851a1 --- /dev/null +++ "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/pom.xml" @@ -0,0 +1,29 @@ + + + 4.0.0 + + org.example + IOC + 1.0-SNAPSHOT + + + junit + junit + 4.13.2 + compile + + + org.springframework + spring-context + 5.3.19 + + + + + 8 + 8 + + + \ No newline at end of file diff --git "a/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/java/com/xju/edu/bean/Cat.java" "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/java/com/xju/edu/bean/Cat.java" new file mode 100644 index 0000000..3e6aa0e --- /dev/null +++ "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/java/com/xju/edu/bean/Cat.java" @@ -0,0 +1,7 @@ +package com.xj.edu.bean; + +public class Cat { + public void test(){ + System.out.println("测试猫类"); + } +} diff --git "a/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/java/com/xju/edu/bean/Dog.java" "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/java/com/xju/edu/bean/Dog.java" new file mode 100644 index 0000000..e4e6711 --- /dev/null +++ "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/java/com/xju/edu/bean/Dog.java" @@ -0,0 +1,7 @@ +package com.xj.edu.bean; + +public class Dog { + public void test(){ + System.out.println("测试狗类"); + } +} diff --git "a/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/java/com/xju/edu/bean/UserBean.java" "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/java/com/xju/edu/bean/UserBean.java" new file mode 100644 index 0000000..41eb5c8 --- /dev/null +++ "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/java/com/xju/edu/bean/UserBean.java" @@ -0,0 +1,24 @@ +package com.xj.edu.bean; + +public class UserBean { + private String username; + private String password; + private Cat cat; + private Dog dog; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } +} diff --git "a/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/java/com/xju/edu/test/TestIOC.java" "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/java/com/xju/edu/test/TestIOC.java" new file mode 100644 index 0000000..ba7f24f --- /dev/null +++ "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/java/com/xju/edu/test/TestIOC.java" @@ -0,0 +1,26 @@ +package com.xj.edu.test; + +import com.xj.edu.bean.UserBean; +import org.junit.Test; +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +public class TestIOC { + @Test + public void test01(){ + ApplicationContext ac = + new ClassPathXmlApplicationContext("applicationContext.xml"); + UserBean userBean = (UserBean) ac.getBean("user"); + System.out.println(userBean); + ((ClassPathXmlApplicationContext)ac).close(); + } + + @Test + public void test02(){ + ApplicationContext ac = + new ClassPathXmlApplicationContext("applicationContext.xml"); + UserBean userBean = (UserBean) ac.getBean("user1"); + System.out.println(userBean); + ((ClassPathXmlApplicationContext)ac).close(); + } +} diff --git "a/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/resources/applicationContext.xml" "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/resources/applicationContext.xml" new file mode 100644 index 0000000..fd8dd6d --- /dev/null +++ "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/src/main/resources/applicationContext.xml" @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/target/classes/applicationContext.xml" "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/target/classes/applicationContext.xml" new file mode 100644 index 0000000..fd8dd6d --- /dev/null +++ "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/target/classes/applicationContext.xml" @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/target/classes/com/xj/edu/bean/Cat.class" "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/target/classes/com/xj/edu/bean/Cat.class" new file mode 100644 index 0000000000000000000000000000000000000000..60586a75aa125f9968b53890baffe0179878b1de GIT binary patch literal 491 zcmZvY%SyvQ6o&ulB{!q3t@VDvUF*VZ1Q!)I1y@0ZO81j=&?&h{nutDwZhZx~XWp%r!oL&=tbI8J;=L}%RbNU7MN%e@YdWZM6Uh4@1D8EUp0`qp*N65Ygd1P`nh zkDCOGML%XR+F=s8;z*_(jjY`szv3oTXew4rtYVG9{Cd9qe!L&vJq!o$D%MSGV3VOb zh0IV+0hY&ubL+(E36~C;klHu>Sorj!Fd?I6XJHvyr;!Zeb{q-r)8(pDWCryz4S500 z)klNbDKsU6^Jb%iZ4~KWre6*eheoSTokf*VE$+O64KmxHRmsFWW@vAY0#s+IW0)Hc f?`JSTe?qR3e?j3NV30*riYgNjeGDm)n?v~*W>94Z literal 0 HcmV?d00001 diff --git "a/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/target/classes/com/xj/edu/bean/Dog.class" "b/2\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/IOC/target/classes/com/xj/edu/bean/Dog.class" new file mode 100644 index 0000000000000000000000000000000000000000..724e5461fe981bbb43167a09158ce0d110dd92b8 GIT binary patch literal 491 zcmZvY%SyvQ6o&ulB{!q3t@VDvUF*Wx2repa6jwooO7}@R)G4`0nutC_*WzPH1r-#0 z03XEq6yixLwF|SDGw1*R^UX{?zF*$~>|x7*f_WVkR5dIZs9{mXl8R*pd-B})e4H1Qn~UD%FCO2rCY+iTmAO#5H45MRnZL(OtSpWpPj=p@_`cEFFr zZj)fK=*J93D@-C+oXC`;k+s{iuWb`5G!-i*RyiaOsdKsdd|rg-0r6XIsENIJ({NDZiKq$ceJL9(f!4G|{aKo5Og#7l{87f4 zf}&V2J3F&8^FA~C{_*+-U=MWzNvvj(z#1RxX>6piDUcZj%6H{Z36xrWc`L1fbbD4i z^c}aiPwzJ}2<|+;E1=sl6sWXpZ)n~3E!7=a9VK1sNQRWCcfDTR>#@geQU{LfgiT6o zY+VT?j=U}@7Fv$0PDjIz@-Jj(5HWbR99&7?VSf@#gx5|Wu>42)lGqOkfdq0r6|y@X zrQFzx8zvY0OsX{g<}e($I{%)UYo?yj_C~&~P8^1v`_kX##hI8x-b4y%6B(ohYO{;_ zN*5?jH+|OWD?3D;J|#&%m4L=A=%#U($Yx@8TzD4>QF^Y;hHflj0^3YAm(A^9*e&ZA8&LaTcNu)p6ED lp3!(drmn?;=(8ZDSdgW75PcS;N+65>fbfDDWH}mrDC zxQY297O-f)EETZq;+BgFL+=w6Df5&eH@~pM&{NgBl3}2xBKax}>oVRJ^?)L!n)XGo zBVuLOonVjIQwhUZ&DSB{Z*sYtaw8MNw`q8>QC*|{cD=I7;0T{#rKaNsPg=2x8t-Ef z%1=7}zEw_$MF218k#@>bao11rI4*R4kvD;`!sNTXfbdBUcPJ06|%Js0;qJitQ_k1S!{ zmeUrGbk%hq18soy!vhgD_(r`ceZz2hzIGhkGWJB)>(`OKZwvP-2c zO`G3^v-LSKGNkLLQw!D3R+?`TkRdE7LMj-_P)~*#Tzij9KsV!rnU0J#llKFiNKC_{ zf5SdGFng*r4$_L#%xKOp9)f+L7YCPU?9GA&l<3`SCtwJ}v?3)ccCzAxn&l`q`vcCq zQtl8vwWU)28+sia!F~A^h2;bEEgiu*K=HVF8F?z|hy7d2#4S%CI| + + + + + + + + + + + + + \ No newline at end of file diff --git "a/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/encodings.xml" "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/encodings.xml" new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/encodings.xml" @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git "a/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/inspectionProfiles/Project_Default.xml" "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/inspectionProfiles/Project_Default.xml" new file mode 100644 index 0000000..6560a98 --- /dev/null +++ "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/inspectionProfiles/Project_Default.xml" @@ -0,0 +1,36 @@ + + + + \ No newline at end of file diff --git "a/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/jarRepositories.xml" "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/jarRepositories.xml" new file mode 100644 index 0000000..355e237 --- /dev/null +++ "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/jarRepositories.xml" @@ -0,0 +1,25 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git "a/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/misc.xml" "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/misc.xml" new file mode 100644 index 0000000..79a352f --- /dev/null +++ "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/misc.xml" @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git "a/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/runConfigurations.xml" "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/runConfigurations.xml" new file mode 100644 index 0000000..797acea --- /dev/null +++ "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/.idea/runConfigurations.xml" @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git "a/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/pom.xml" "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/pom.xml" new file mode 100644 index 0000000..593e415 --- /dev/null +++ "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/pom.xml" @@ -0,0 +1,82 @@ + + + + 4.0.0 + + org.example + work_2 + 1.0-SNAPSHOT + war + + work_2 Maven Webapp + + http://www.example.com + + + UTF-8 + 1.7 + 1.7 + + + + + junit + junit + 4.11 + test + + + + org.springframework + spring-beans + 5.3.18 + + + org.springframework + spring-context + 5.3.18 + + + junit + junit + 4.12 + + + + + work_2 + + + + maven-clean-plugin + 3.1.0 + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-war-plugin + 3.2.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + + diff --git "a/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/java/com/xju/edu/Demo.java" "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/java/com/xju/edu/Demo.java" new file mode 100644 index 0000000..a6458f6 --- /dev/null +++ "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/java/com/xju/edu/Demo.java" @@ -0,0 +1,90 @@ +package com.xju.edu; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + + +@Component +public class Demo { + @Value("${uname}") + private String name; + @Value("${uage}") + private int age; + @Value("#{@list1}") + private List list; + @Value("#{@set1}") + private Set set; + @Value("#{@map1}") + private Map map; + @Value("#{@properties1}") + private Properties properties; + /*设置引用类型:DI注入*/ + // @Autowired 实现自动装配的注解,可以完成自定义bean类型属性的注入 + // 说明:先按照类型进行匹配,如果找到唯一的就注入 + // 如果找不到,就按照id进行注入,如果都找不到,抛出异常 + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public Set getSet() { + return set; + } + + public void setSet(Set set) { + this.set = set; + } + + public Map getMap() { + return map; + } + + public void setMap(Map map) { + this.map = map; + } + + public Properties getProperties() { + return properties; + } + + public void setProperties(Properties properties) { + this.properties = properties; + } + + @Override + public String toString() { + return "Demo{" + + "name='" + name + '\'' + + ", age=" + age + + ", list=" + list + + ", set=" + set + + ", map=" + map + + ", properties=" + properties + + '}'; + } +} diff --git "a/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/java/com/xju/edu/TestDemo.java" "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/java/com/xju/edu/TestDemo.java" new file mode 100644 index 0000000..98f8a05 --- /dev/null +++ "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/java/com/xju/edu/TestDemo.java" @@ -0,0 +1,18 @@ +package com.xju.edu; + +import org.junit.Test; +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +import java.io.IOException; + +public class TestDemo { + @Test + public void test01() throws IOException { + + ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml"); + Demo demo = (Demo) ac.getBean("demo"); + System.out.println(demo); + ((ClassPathXmlApplicationContext) ac).close(); + } +} diff --git "a/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/resources/applicationContext.xml" "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/resources/applicationContext.xml" new file mode 100644 index 0000000..ee62f36 --- /dev/null +++ "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/resources/applicationContext.xml" @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + v1 + v2 + v3 + + + s1 + s2 + s3 + + + + + + + + + p1 + p2 + p1 + + + + + + + diff --git "a/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/resources/demo.properties" "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/resources/demo.properties" new file mode 100644 index 0000000..4cd13d5 --- /dev/null +++ "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/resources/demo.properties" @@ -0,0 +1,2 @@ +uname='lzj' +uage=20 \ No newline at end of file diff --git "a/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/webapp/WEB-INF/web.xml" "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/webapp/WEB-INF/web.xml" new file mode 100644 index 0000000..9f88c1f --- /dev/null +++ "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/webapp/WEB-INF/web.xml" @@ -0,0 +1,7 @@ + + + + Archetype Created Web Application + diff --git "a/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/webapp/index.jsp" "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/webapp/index.jsp" new file mode 100644 index 0000000..c38169b --- /dev/null +++ "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/src/main/webapp/index.jsp" @@ -0,0 +1,5 @@ + + +

Hello World!

+ + diff --git "a/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/target/classes/applicationContext.xml" "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/target/classes/applicationContext.xml" new file mode 100644 index 0000000..ee62f36 --- /dev/null +++ "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/target/classes/applicationContext.xml" @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + v1 + v2 + v3 + + + s1 + s2 + s3 + + + + + + + + + p1 + p2 + p1 + + + + + + + diff --git "a/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/target/classes/com/xju/edu/Demo.class" "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/target/classes/com/xju/edu/Demo.class" new file mode 100644 index 0000000000000000000000000000000000000000..24ad70246c4aa776e27004a249eae84fcfad68f1 GIT binary patch literal 3103 zcmb7GYjfLF5Iu7IO5!xB+opvUNXg52RV__uAPwxP2JL<6fM@*Rp&g z%bqOX%JQ8o-)ErpA&bXZ?8~<-%Rv^pd=Imz$oEMWMixg|Je6HFgIWfrf~2X{bOrh1 zk@ieetD0F+ORi&>l_dplJ!qJ&QPX#gy0Kr?*GaJF8=!8r?6G1_C>_tN&zf{npRj5$56lAF6hPq_csJjY= zd{zzDsH#P32+&(HDyHT(9Quq!j+Z+xu_`X3FV+O_ngpxs#2svNEa?I}8rF0{$`XkH z9#BoQ!$8}bO`wG~AZlWO+DP8rKhn$Yl8_W=LJD-B?O3+%xQ5O=54YjnYwGDRNQai8 z_@$Q(({NXL$->kwbGTt0FiC?&!_;>gwSC=rsIiJtYpbkPcQwb5eV|ObPYj037t2;n z{pqNo>IV&VQ?FSJm8t0Nj@Kq<3sY_Mn~joTQhbARh0b#!lP1Kv)S28^=` z#}YvbOadnn+KWEXp^V9^WKoFtIA;PPEf|S29KQN<`{eqQQS;aUCpRfc6P*r`qKfgy zqq1tpO3=l2cK;n#TnAX@ zRue0@5Te*RVI~L2p{3v~YLD7F@EB!X%Wp-#os!jX%KB|X8ogKg_lgWQ1=F$fs_yEJ zZn^9Ob;GLJmZ_WWQVv&fEr;{Cki$E8H-`~i&S4xAIZRt^%wtROy=6k2vE*3cu zqpy>y77>4(5JR(V-8@h*7bLBHtam=(fH{+Xsj%_p;|IUN=c)*%)eV-l)j7B}jsARpG29r^P0*_eBrol|qV3tR$ zb7yQ7r>JCuaQ%SMRelwIQ`4`Z{N~ZQ&Nb~R2QW`L=Nn)FA9APQ1{S%7oqtE-*NF2- ztn)|sIB;Gi#e{^Ko_U2tD|DZy9YcyKknqF4RS;gN`Po*mgyk3_J-_2V6}tD z#aHNw5}75Dxh_Qf>MHmIYa|)XNHUs{t1(3U4p=9Zo7f0I?(y5qOi~E-@E<9_&&)gt zEp#CyU8P`?wtmsl?6Xm7{3y35-NvUeR8vu^i(RSSA;=a!i=&!~Qe7t1l`d4Jzr$3= zG1;X0Ii(`DW2mO1RM)yv-66-ZpV9-AxJDZw z6Qz15hN^;x_#$u)J&8=T6N{v{-G!q6))kqu0oKpFwmj^;KaqX(8ol|xWAsn+o$@m@ zd5m0sz*qDf<5Ygomy^dB%AfY-l*oBsPK$iTmot=yUJ~FKXQLOq-*&;h;Ke5JC21t^ Ml{cegusj0(1s%_3Qvd(} literal 0 HcmV?d00001 diff --git "a/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/target/classes/com/xju/edu/TestDemo.class" "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/target/classes/com/xju/edu/TestDemo.class" new file mode 100644 index 0000000000000000000000000000000000000000..5da4b8b38d5a00d2c847b5eacc65baf9fea8cb76 GIT binary patch literal 1023 zcmaJ=TTc@~6#k~SrON`f2#8luz;dyRcMZk_iY6vih$TcHhh;2NcXyiIS*<@yA0TRC zc=ksb&uj}+A?(9k&YbgI&dmP)^WztQ`*>=@!3_&j1DLjv!Oa0o4B{4MEX)=$hubzP zm^UX278WfmF%+K3Q0nIl*~PhT=^U?1*TK@Awoc*OkZpZ5~Op?*(&u zPsR-6bx#Furqfi9GRA8h1lSqN^?bi8~m=FvHq;a^s}kR*`mVK9A!~uJ_&r{%H%; z8-B`HwG;S;qH4i)ung)?>3@F~?m2X!4=g-%@Cc6`JTa0k_U9dGrgEd&^?BHIH+EXW z(+s0&NGkW$#&Mq*#wzub)P^=Uv0|>hdY;v@Y*|gA*8~q4=FWobW9bT_hWCkVe2KLP z=*_8wq>gp7N$VyF(j-gpfC`Q+^o1EL^M15X%>S6_(HJv%&sVX)GzRH!Fkc3A!x*M< zgmx~?jOP5p0od2{xI|+i4Hj{M)=oD8WsK5}+D^sUv^b_YOR?FX$hu(rX+DCEm5Se}0C*b4AQ_&D?0vacvYbarcs0`Uu7qCZW;|j(ohh7flP2du# WpQNlDMK04>SLjum8KD?&*Z%_LDEm$T literal 0 HcmV?d00001 diff --git "a/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/target/classes/demo.properties" "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/target/classes/demo.properties" new file mode 100644 index 0000000..4cd13d5 --- /dev/null +++ "b/3\344\275\234\344\270\232-20202501420-\345\210\230\350\265\265\346\235\260/DI/target/classes/demo.properties" @@ -0,0 +1,2 @@ +uname='lzj' +uage=20 \ No newline at end of file -- Gitee