ITeye博客

实例化Spring容器

nbh219 · 2013-09-02 22:02 · Spring · 编程语言 · Markdown

实例化Spring容易的两种方法

在类路径下寻找配置文件

ApplicationContext ctx = new ClassPathXmlApplicationContext(new String[]{"beans.xml"})

 

 

在文件系统路径下寻找配置文件

ApplicationContext ctx = new fileSystemXmlApplicationContext(new String[]{"d:\\beans.xml"})

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。