<?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-2.5.xsd">
<bean id="helloWorld_Alias" class="cn.google.spring.sh.ioc.createobject.HelloWorld">
<!-- name 的属性和 bean 的id 对应 -->
<alias name="helloworld_Alias" alias="李四" />
</beans>
Spring 别名的使用
最新推荐文章于 2025-05-22 09:25:36 发布
本文详细解析了Spring IoC容器的配置方式,包括bean的定义、属性注入、别名设置等核心概念,帮助开发者理解并掌握Spring IoC的基本用法。
984

被折叠的 条评论
为什么被折叠?



