Announcement Announcement Module
Collapse
No announcement yet.
Loading multiple beans.xml with XmlWebApplicationContext Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Loading multiple beans.xml with XmlWebApplicationContext

    In my web.xml

    Code:
    <context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>
    			/WEB-INF/simple-servlet.xml,
                            /WEB-INF/simple-dao.xml,
                            /WEB-INF/simple-utilities.xml
    		</param-value>
    </context-param>
    	
    <listener>
    		<listener-class>
    			org.springframework.web.context.ContextLoaderListener
    		</listener-class>
    </listener>
    It seems loading multiple bean definition XML files does not work the way I expect. The last loaded XML file seems to overwrite all previous loaded XML files. In above example, the simple-utilities.xml would overwrite all other definitions defined in simple-dao.xml and simple-servlet.xml. Another word, anything defined in both simple-dao.xml and simple-servlet.xml disappear after simple-utilities.xml is loaded, or may be there is a bug in the XmlWebApplicationContext that prevent multiple bean definition files from loading properly.

    I am using the latest stable spring 3.0 release. (This is not an issue with Java base Config. @Configuration annotated class can successfully load multiple xml files)
    Is this a correct behavior?
    Last edited by zollen; Feb 15th, 2010, 01:43 PM.

  • #2
    [SOLVED] oops! my mistake

    Configuration error fixed.

    Comment


    • #3
      Hi,

      It would be helpful to others if you share what mistake was done by you.

      -Hetal

      Comment

      Working...
      X