Software Development

How to use Spring XmlBeanFactory

Background

[wp_ad_camp_1]

XmlBeanFactory is one of Spring’s containers that provide dependency injection. Note that it has been deprecated already. This means that you should not use this in new development projects.

Software Environment

  • Windows 7 Professional SP1
  • Eclipse – Kepler Release
  • Java 1.7 (1.7.0_67 – Windows x86)
  • Spring Framework
    • Spring Context 4.1.2

Maven Dependencies

Bean Configuration File

A bean configration file is an XML file that contains all objects instantiated when the container starts.

JavaBeans

AnimalBean.java

PersonBean.java

[wp_ad_camp_5]

The Main Class

Sample Output

Download the Project

[wp_ad_camp_4]

https://www.dropbox.com/s/tfcxwdj2x49jx1i/turretaSpringDIBeanFactory.zip?dl=0

 

Loading

Got comments or suggestions? We disabled the comments on this site to fight off spammers, but you can still contact us via our Facebook page!.


You Might Also Like