• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Ioc springconfig.xml

 
Ranch Hand
Posts: 401
Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
may i when are the objects created through spring.xml (IoC) file are available to use in the parts of application? at runtime?

thanks in advance
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you create the Spring container with ApplicationContext context = new ClassPathXmlApplicationContext("springconfig.xml"), Spring will read in the xml and create instances of your objects and set the dependencies between those objects in that one line of code. After that line of code, all those objects are now available for you to use by getting it out of the applicationContext with a call to getBean(). All that happens at runtime.

Mark
 
Rauhl Roy
Ranch Hand
Posts: 401
Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mark Spritzler wrote:When you create the Spring container with ApplicationContext context = new ClassPathXmlApplicationContext("springconfig.xml"), Spring will read in the xml and create instances of your objects and set the dependencies between those objects in that one line of code. After that line of code, all those objects are now available for you to use by getting it out of the applicationContext with a call to getBean(). All that happens at runtime.

Mark



more than many thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic