Interview Question : What is Difference between BeanFactory & ApplicationContext ?
Click Here for answer
ApplicationContext is mostly used in web applications with Spring MVC.
Note: ApplicationContext is "New Spring Container" as compared to BeanFactory, so we should always use ApplicationContext in real world projects.
ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
ApplicationContext context = new FileSystemXmlApplicationContext("/path/to/beans.xml");
ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
Your feedback helps us grow! If there's anything we can fix or improve, please let us know.
Weโre here to make our tutorials better based on your thoughts and suggestions.