Spring基础01——在IDEA中编写spring.xml

如果需要在IDEA自动创建spring.xml配置文件,那么我们就需要先引入Spring相关的依赖

1 <dependency>
2      <groupId>org.springframework</groupId>
3      <artifactId>spring-context</artifactId>
4      <version>5.1.1.RELEASE</version>
5 </dependency>

引入之后我们就可以看到效果

自动生成的spring 配置文件:

1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns="http://www.springframework.org/schema/beans"
3        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
5 
6 </beans>
原文地址:https://www.cnblogs.com/fengyun2019/p/10818824.html