Reputation: 243
I have a requirement that I want to initialize a bean before any other bean in my application context. One way to do is to use "depends-on" on every other bean but its too verbose as I have many beans in my application-context.
Is there any other way to do this. I have read abt implementing ServletContext for this but I dont think this will work as this has nothing to do with Spring.
Please let me know your thoughts on it.
Thanks, Raunak
Upvotes: 2
Views: 856
Reputation: 136152
Make sure that your bean comes first in your context.xml and it will be instantiated first. You can make a simple test to verify.
Upvotes: 1