Hi,
I'm working on a Spring +
Struts web application. I am using the Delegating Action method, so I have the plug-in defined in struts-config.xml
Since I need to use the Spring-managed beans in my InitServlet, so I have the following in web.xml.
This works but I find that there are two Spring context for my app.
Log
==========================================
- Root WebApplicationContext: initialization started
- Loading Spring root WebApplicationContext
- Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
-
Bean factory for application context [Root WebApplicationContext]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [dataSource,transactionManager,transactionTemplate,...]; root of BeanFactory hierarchy
- 21 beans defined in application context [Root WebApplicationContext]
........
- Root WebApplicationContext: initialization completed in 531 ms
- Loading validation rules file from '/WEB-INF/validator-rules.xml'
- Loading validation rules file from '/WEB-INF/validation.xml'
- ContextLoaderPlugIn for Struts ActionServlet 'action, module '': initialization started
- Initializing WebApplicationContext for Struts ActionServlet 'action', module ''
- Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
-
Bean factory for application context [WebApplicationContext for namespace 'action-servlet']: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [dataSource,transactionManager,transactionTemplate,...]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [dataSource,transactionManager,transactionTemplate,...]; root of BeanFactory hierarchy
- 21 beans defined in application context [WebApplicationContext for namespace 'action-servlet']
.........
==================================================
So my question is is it normal to have 2 contexts for a single web app? If no, how can I reduce to use a single context?
Thanks for your help.
Michael