Hi All,
I'm a newbie here. I have what I hope is a fairly straightforward question about application contexts.
It appears that my application has two application contexts - the root context which is created by the ContextLoaderListener, and a child context which is created by my action servlet (I'm using struts 1.2.9). The struts servlet is integrated with Spring using Spring's DelegatingRequestProcessor. The child context appears to be an exact copy of the root context.
So I have two questions:
1. Why does the servlet need a copy of the root context? Can it not use the root context directly?
2. How do I change it to use the root context? I need to do this because I'm using the hibernate OpenSessionInViewFilter. Since there are two contexts, the filter ends up being intialized with a different sessionFactory from the daos that the action servlet uses. Thus the OSIV filter doesn't work.
I assume if I were using Spring MVC, the dispatcher servlet would also have this problem?
Thanks in advance,
Owen
ps. I'm using Spring 2.08 and Tomcat 5.5 (which uses servlet api 2.4 - I think). I can post the code here if necessary.


Reply With Quote
