<?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 的 scope 属性来配置 bean 的作用域
singleton: 默认值. 容器初始时创建 bean 实例. 在整个容器的生命周期内只创建着一个 bean. 是单例的
prototype: 原型的. 容器初始化时不创建 bean 的实例. 而在每次请求时都创建一个新的 bean 的实例. 并返回
-->
<bean id="car" class="com.atguigu.spring.beans.autowire.Car"
scope="prototype">
<property name="brand" value="baoma"></property>
<property name="price" value="300000"></property>
</bean>
</beans>
Spring学习-day05
原创
©著作权归作者所有:来自51CTO博客作者Adam的blog的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:Spring学习-day04
下一篇:Spring学习-day06
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Day05-docker-仓库
仓库的应用、一些小细节
docker json -
SQL学习day5
SQL学习day5
聚合函数 窗口函数 MySQL -
springMVC学习-day05
国际化标签
springMVC 学习 day05 -
day05
day05344. 反转字符串力扣题目链接题目编写一个函数,其作用是将输入的字符串反转过来。输入字符串以字符数组 s 的形式给出。不要给
java 算法 力扣 字符串 数据结构 -
Java入门学习Day05
本篇文章主要有创建package、关系运算符、逻辑运算符、三元运算符和其对应的实例。
学习 System 逻辑运算符 三元运算符 -
python讲义学习 day05
day05
python 学习 开发语言 元组 字符串