Announcement Announcement Module
No announcement yet.
Dynamically injecting properties at run time Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dynamically injecting properties at run time

    Can a spring bean be initialized with run time properties? (For example, passing properties to bean from a Java main method's arguments?) If so, how can the properties be injected into other beans in the Spring container?
    All of the examples I have seen show DI using constant properties that are defined in an XML file or properties file

    Sorry for the dumb question, I am just trying to understand the concept of DI better. My perception is all the beans are initialized when the applicationContext is invoked.
    Last edited by suncds; Jul 19th, 2013, 03:30 PM.

  • #2
    actually, all the bean definitions are initialized when the application context is initialized.