Spring ----XML的配置说明
作者:互联网
1.别名 给id 起别名:
<bean id="hello" class="com.chen.pojo.Hello"> <property name="id" value="1"/> <property name="name" value="lll"/> </bean>
<alias name="hello" alias="hello2" /> //alias 的name 指代bean 对应id hello2 是别名
<bean id="hello" class="com.chen.pojo.Hello" name="v1 v2,v3;v5> name是bean 的内部别名可以去多个,用空格 逗号 分号分隔 <property name="id" value="1"/> <property name="name" value="lll"/> </bean>
3.import 导入其他的bean配置文件合并一个文件:<import resource="aaa.xml"/>
4. bean -->property -->constructor-arg name value ref
标签:XML,name,配置文件,Spring,配置,别名,bean,指代,id 来源: https://www.cnblogs.com/chencn/p/12330805.html