The 3 commonly used implementation of ApplicationContext are :
1. ClassPathXmlApplicationContext
It Loads context definition from an XML file located in the classpath, treating context definitions as classpath resources.
The application context is loaded from the application's classpath by using the code :
Example
ApplicationContext context =
new ClassPathXmlApplicationContext("bean.xml");
ApplicationContext context =
new ClassPathXmlApplicationContext(
new String[] {"services.xml", "dao.xml"});
2. FileSystemXmlApplicationContext
It loads context definition from an XML file in the filesystem.
The application context is loaded from the file system by using the code.
Example
ApplicationContext context =
new FileSystemXmlApplicationContext("bean.xml");
3. XmlWebApplicationContext
It loads context definition from an XML file contained within a web application.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.