读取web-inf目录下的spring配置文件
项目结构
ApplicationContext applicationContext = new FileSystemXmlApplicationContext("src/main/webapp/WEB-INF/smart-context.xml");
this.userService = (UserService)applicationContext.getBean("userService");
可以加载配置文件,获取bean
项目结构
ApplicationContext applicationContext = new FileSystemXmlApplicationContext("src/main/webapp/WEB-INF/smart-context.xml");
this.userService = (UserService)applicationContext.getBean("userService");
可以加载配置文件,获取bean