<?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");
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者