Jan 8th, 2013, 12:52 PM
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?
Jan 9th, 2013, 01:41 AM
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.
Tags for this Thread