I my application I have an application-context.xml. Now I am instantiating The ApplicationContext as:
ApplicationContext context = new ClassPathXmlApplicationContext("application-context.xml");
Is it possible to pass parameter through this instantiation so that those parameters could be used to initialize some properties of some beans?
PS: Not using property file. As the parameters are generated run time, like exicutable jar’s location, system architecture, os name etc which is variable.
Here is the solution, I am posting it, might be helpful to someone in future:
The Bean class:
The initialization of the ApplicationContext:
The injection of this bean reference to another bean of application-context.xml:
Thanks.