`

spring配置文件的解读

    博客分类:
  • java
阅读更多

spring配置文件的解读

来自:《精通Spring》--罗时飞第31页

 

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
     <bean name="fileHelloWorld" class="com.openv.spring.HelloWorld">    //--对象名:fileHelloWorld
     <constructor-arg>
         <ref bean="fileHello" />            //--指明fileHelloWorld对象初始化时要引用的另一个对象是fileHello
     </constructor-arg>
</bean>
<bean name="fileHello" class="com.openv.spring.FileHelloStr" >   //--对象名:fileHello(被上一个对象使用)
    <constructor-arg>
          <value>helloworld.properties</value>                       //--指明fileHello对象初始化时使用的参数文件
    </constructor-arg>
</bean>
</beans>

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics