环境配置
1、添加jar包
- spring-beans-4.1.3.RELEASE.jar
- spring-context-4.1.3.RELEASE.jar
- spring-core-4.1.3.RELEASE.jar
- spring-expression-4.1.3.RELEASE.jar
2、配置文件
(1)在下创建一个config文件夹
(2)在文件夹下创建一个xml文件
(3)在文件中添加以下内容
<?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
https://www.springframework.org/schema/beans/spring-beans.xsd">
<beans>
获得配置文件代码的方法
1、进入spring的官网
2、进入该界面
3、
4、点击Reference
5、点击core
6、该段代码即为所需