Hi,
How can I use the same application context in multiple function in a program?
What i actually need to do is this : I have an application context defined in my main function.I need to use that context to get a bean in another function .
Hi,
How can I use the same application context in multiple function in a program?
What i actually need to do is this : I have an application context defined in my main function.I need to use that context to get a bean in another function .
No you don't, nor should you... You should only need to ApplicationContext for bootstrapping your application all other beans/classes should be given their dependencies and shouldn't do a lookup.
Marten Deinum
Java Consultant / Pragmatist / Open Source Enthousiast / Author
Pro Spring MVC: With Web Flow
Conspect
Have you read the reference guide.
Use the [ code ] tags, young padawan
I'm confused.
can u explain the use ApplicationContextAware interface?![]()
As stated before
You shouldn't need the applicationcontext other then to bootstrap the application all the other beans/dependencies should be wired together... Your application shouldn't rely on the ApplicationContext internally (preferably your code should be aware of spring only in some bootstrapping logic).Originally Posted by mdeinum
Marten Deinum
Java Consultant / Pragmatist / Open Source Enthousiast / Author
Pro Spring MVC: With Web Flow
Conspect
Have you read the reference guide.
Use the [ code ] tags, young padawan