Results 1 to 4 of 4

Thread: Application context in multiple funtions

  1. #1
    Join Date
    Aug 2012
    Posts
    16

    Default Application context in multiple funtions

    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 .

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    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

  3. #3
    Join Date
    Aug 2012
    Posts
    16

    Default

    I'm confused.
    can u explain the use ApplicationContextAware interface?

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    As stated before

    Quote Originally Posted by mdeinum
    No you don't, nor should you... You should only need to ApplicationContext for bootstrapping your application
    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).
    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •