what is used to load the bean configuration file located at the specified class path?
时间: 2024-03-21 10:41:53 浏览: 20
To load the bean configuration file located at the specified classpath, you can use the ApplicationContext interface from the Spring Framework. The ApplicationContext provides several implementations, such as the ClassPathXmlApplicationContext, which is used to load the XML configuration file from the classpath. You can use the following code to load the bean configuration file:
```
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:bean-config.xml");
```
Where "bean-config.xml" is the name of the bean configuration file located at the root of the classpath. This will load the bean definitions from the configuration file and create the corresponding beans in the application context.