美文网首页
Spring xml

Spring xml

作者: lovePython | 来源:发表于2015-08-19 21:16 被阅读42次
<?xml version="1.0"?>
<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="helloBean" class="com.mkyong.common.HelloWorld">
        <property name="name" value="Mkyong" />
    </bean>
</beans>
        ApplicationContext context = new ClassPathXmlApplicationContext("Spring-Module.xml");       
        HelloWorld obj = (HelloWorld) context.getBean("helloBean");        

相关文章

网友评论

      本文标题:Spring xml

      本文链接:https://www.haomeiwen.com/subject/calgqttx.html