首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

Properties配备格式加载

2012-06-26 
Properties配置格式加载?package com.ls.spring.ioc.dummyimport org.springframework.beans.factory.sup

Properties配置格式加载

?

package com.ls.spring.ioc.dummy;import org.springframework.beans.factory.support.DefaultListableBeanFactory;import org.springframework.beans.factory.support.PropertiesBeanDefinitionReader;public class TestBeanFactoryViaProperties {public static void main(String[] args) {DefaultListableBeanFactory factory = new DefaultListableBeanFactory();PropertiesBeanDefinitionReader reader = new PropertiesBeanDefinitionReader(factory);reader.loadBeanDefinitions("classpath:com/ls/spring/ioc/dummy/ioc-test.properties");A a = (A) factory.getBean("a");a.getB().put();}}

?

?

?

热点排行