• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic