Monday, May 7, 2012

How to access the beans from the XML file by BeanFactory




To access the Beans from the XML file we can use BeanFactory.(see the example)

             BeanFactory fact=new XMLBeanFactorynew (new FileSystemResources("XMLfilename.xml"));

To access the Beans from the XML file we can also use ApplicationContext.

             ApplicationContext context=new ClassPathXmlApplicationContext("XMLfilename.xml");


For Further Reading,
General, How To, Java, spring

0 comments:

Post a Comment


 

Site Status

Man Behind Technical Today

Hello, I am Navin Bansal. I am a student of MCA in Rajsthan Institute of Engineering and Technology and owner of this blog. I share my view and ideas among people.