I know that:
-
ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");loads context definition from an XML file located in the classpath, treating context definitions as classpath resources.
-
ApplicationContext context = new FileSystemXmlApplicationContext("bean.xml");loads context definition from an XML file in the filesystem.
-
XmlWebApplicationContextloads context definition from an XML file contained within a web application.
But, what does it exactly mean??
Thanks 🙂
ClassPathXmlApplicationContextwill read files from your classpath. They must be inclassesfolder of your web application or in ajarin yourlibfolder.FileSystemXmlApplicationContextcan access all your file system, for examplec:/config/applicationContext.xml.XmlWebApplicationContextcertainly can access to files contained in your web application, but this is not the most important thing. It implements WebApplicationContext and this means that it will detect ServletContextAware beans, register custom scopes (request, session, …) among other things.