Spring ioc容器

Spring ioc容器

导入 spring 容器包

image-20230521162418420

  • 找到 Spring Web MVC
  • 点击 spring-webmvc 进入

image-20230521162616403

  • 选择一个版本号点击,我这边选择的是 6.0.9

image-20230521162712646

  • 将这个导入 maven内即可

image-20230521162834176

  • 或者之间复制我下面的 maven 包
  <dependency>
           <groupId>org.springframework</groupId>
           <artifactId>spring-webmvc</artifactId>
           <version>6.0.9</version>
     </dependency>

image-20230521163000309

  • 点击 idea 右侧的 maven 图标下载一下包即可

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-zuylo7wD-1684659092673)(D:/%E7%AC%94%E8%AE%B0/Y2/%E5%AF%BC%E5%85%A5spring%E5%8F%8A%20ioc%E5%AE%B9%E5%99%A8%E5%8C%85.png)]

导入 ioc 容器包

  • 在 spring 官网找到 ioc容器的元数据

  • **在官网的 ico容器概述内可以找到 网站:Container Overview :: Spring Framework **

  • 网址: https://docs.spring.io/spring-framework/reference/core/beans/basics.html

  • 进入官网下滑找到 <beans> 标签的内容复制

image-20230521164342288

  • 或者直接复制我下面的
<?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">

	<bean id="..." class="...">
		<!-- collaborators and configuration for this bean go here -->
	</bean>

	<bean id="..." class="...">
		<!-- collaborators and configuration for this bean go here -->
	</bean>

	<!-- more bean definitions go here -->

</beans>
  • 进入 idea,在 resources 文件夹新建 applicationContext.xml

image-20230521164842355

  • <beans> 标签内的内容粘贴进去即可

image-20230521165105235
92674)]

  • <beans> 标签内的内容粘贴进去即可

[外链图片转存中…(img-W36wNFMj-1684659092674)]

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值