摘要: 在web.xml中加入 org.springframework.web.context.ContextLoaderListener如果applicationContext.xml不在/WEB-INF下就要在家在web.xml加入 contextConfigLocation classpath*:config/applicationContext*.xml 阅读全文
posted @ 2012-03-24 23:05 YH_W 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 使用springApplicationContext context = new FileSystemXmlApplicationContext("src/applicationContext.xml");IDISK idisk = (IDISK)context.getBean("disk");//根据配置文件的内容实例化对象并返回配置文件scope="prototype"取消单态,延迟加载只针对单态的bean适用,非单态的bean本来就是“延迟加载”<bean id="dbreader" class=&qu 阅读全文
posted @ 2012-03-24 18:41 YH_W 阅读(213) 评论(0) 推荐(0) 编辑