Results 1 to 2 of 2

Thread: ApplicationContext Hierarchy

Hybrid View

  1. #1
    Join Date
    Mar 2010
    Posts
    6

    Default ApplicationContext Hierarchy

    In a web application, when you have multiple separate contexts, for example a global context loaded by a Listener and several servlet contexts, what are the rules governing how the parent-child hierarchy is established?

    I spent a few hours searching the docs and the web, and was unable to find a definitive answer. There's an answer on StackOverflow (http://stackoverflow.com/questions/7...ontext#7748108) that says Spring sets this up, but gives no details.

    Is this documented anywhere?

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

    Default

    Spring indeed sets this up.

    The dispatcherservlet detects the context loaded by the contextloaderlistener and uses that as a prent for its own applicationcontext. Each dispatcherservlet has its own applicationcontext which has the one from the contextloaderlistener as a parent. Detection is done based on name as it is stored in the ServletContext.
    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
  •