首页 > 代码库 > 自己的一份Spring的xml配置文件

自己的一份Spring的xml配置文件

<?xml version="1.0" encoding="UTF-8"?>
<beans
 xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:context="http://www.springframework.org/schema/context"
 xsi:schemaLocation="http://www.springframework.org/schema/beans
                    http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
                    http://www.springframework.org/schema/context
                    http://www.springframework.org/schema/context/spring-context-4.0.xsd
">
<bean id="hello" class="org.feiruanstudio.springbasic.Bean"></bean>

<!-- 构造函数注入 -->
<!-- 属性函数注入 -->
<bean id="id" class="class">
     <constructor-arg value="http://www.mamicode.com/const"/>
    <property name="songName" http://www.mamicode.com/value="value"/>
</bean>

<!-- 静态工厂注入 -->
<bean id="staticsong" class="org.feiruanstudio.springbasic.StaticSong"
     factory-method="getInstence">
</bean>


</beans>