whbing 2020-02-20
Spring 是分层的 Java SE/EE 应用 full-stack 轻量级开源框架,以 IoC(Inverse Of Control:反转控制)和 AOP(Aspect Oriented Programming:面向切面编程)为内核。
1.创建Maven工程,不选择骨架
2.在pom.xml中引入spring的依赖(https://mvnrepository.com/ 找Spring Context)
3.在resources中新建bean.xml
4.bean.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"> <!--把对象的创建交给spring来管理--> <!-- <bean id="iAccountService" class="org.example.service.impl.AccountServiceImpl"></bean>--> </beans>