junit_4.12.jar
org.hamcrest.core_1.3.0.jar
spring-beans-5.2.5.RELEASE.jar
spring-context-5.2.5.RELEASE.jar
spring-core-5.2.5.RELEASE.jar
spring-expression-5.2.5.RELEASE.jar
spring-jcl-5.2.5.RELEASE.jar
3 创建 Person 类:
public class Person {
private Integer id;
private String name;
private String phone;
private Integer age;
4 在 src 源码目录下编写 applica#onContext.xml 配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<!--
bean 标签表示配置一个 Bean 对象实例
class 属性表示对象的具体全类名
id 属性设置唯一标识
-->
<bean class="com.atguigu.pojo.Person" id="p1">
<!-- property 标签是通过 setXxx 方法对属性赋值操作
评论0
最新资源