读书人

spring配置文件获取形式

发布时间: 2012-11-04 10:42:41 作者: rapoo

spring配置文件获取方式

1、在src下(class):??

ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");//spring 上下文

?2、在/WebRoot/WEB-INF/下(带路径的)

ApplicationContext ctx = new FileSystemXmlApplicationContext("/WebRoot/WEB-INF/applicationContext.xml");//spring 上下文

?

读书人网 >软件架构设计

热点推荐